Hi David, On Tue, Nov 15, 2011 at 09:08:37AM -0800, David Prothero wrote: > I don't see where you can turn off Nagle for HAProxy. All I could find > was a change in the source code back in 2006 where Willy took OUT the > TCP_NODELAY flag.
In fact it's not removed, it's present but we're using MSG_MORE on outgoing segments when we know there are more to come so that the system can merge them before sending them out. What you describe sounds like an issue with TCP window being full and not ACKed on the other side. It is for instance possible that the data you're transfering is not multiple of 2 segments and that the receiving machine ignores the PUSH flag that should be sent at the end of a chunk. I would be interested in knowing if this still happens with the "http-no-delay" option which forces TCP_NODELAY on every outgoing segment and prevents the system from merging them. Doing so can increase load time on high latency networks due to output window being filled earlier with incomplete segments and due to the receiver having to ACK every segment, which can lead to uplink saturation on asymmetric links (ADSL, HSDPA). In any case, a tcpdump capture between the client and haproxy would be useful so that we know who's waiting for whom. Note that it is also possible that you simply have too short windows on your system. They're limited by the TCP write buffers (for instance, net.ipv4.tcp_wmem on linux). You can check if increasing the default value improves things, which would then mean that you're simply limited by the bandwidth-delay product. Regards, Willy

