[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postfix-users
Subject:    Re: postfix milter body chunk length
From:       Wietse Venema <wietse () porcupine ! org>
Date:       2019-08-20 13:47:14
Message-ID: 46CXCk0zyczJrNs () spike ! porcupine ! org
[Download RAW message or body]

Matthias Schneider:
> Once i do "ip link set dev lo mtu 21845" i will get vstream_tweak_tcp: 
> TCP_MAXSEG 21793 and the performance is great (only 1 second for 100mb 
> body).

In both cases, Postfix was sending 65535-byte body chunks?

Then the problem was that getsockopt(TCP_MAXSEG) returned a too
small MSS value. As implemented, vstream_tweak() will use 2x the
the TCP_MAXSEG result for its I/O buffer size, to allow for dynamic
changes in network routing. In your case, the 2x multiplier was not
sufficient.

If you have source, can you try the patch below:

--- ./src/util/vstream_tweak.c-	2014-12-25 11:47:17.000000000 -0500
+++ ./src/util/vstream_tweak.c	2019-08-20 09:45:52.000000000 -0400
@@ -132,6 +132,8 @@
     if (mss > EFF_BUFFER_SIZE(fp) / 2) {
 	if (mss < INT_MAX / 2)
 	    mss *= 2;
+	if (mss < INT_MAX / 2)
+	    mss *= 2;
 	vstream_control(fp,
 			CA_VSTREAM_CTL_BUFSIZE(mss),
 			CA_VSTREAM_CTL_END);

Yes, this duplicates two lines of code.

	Wietse
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic