* Setting TCP_NODELAY doesn't disable Nagle's alg. on loopback
@ 2006-05-16 8:50 Radko Mihal
2006-05-16 16:16 ` Stephen Hemminger
0 siblings, 1 reply; 3+ messages in thread
From: Radko Mihal @ 2006-05-16 8:50 UTC (permalink / raw)
To: netdev
Hi,
We are facing strange problem with disabling the Nagle's algorithm via setting the TCP_NODELAY flag on server socket (setsockopt), where server is communication with client via loopback.
After the first segment (of the response) is sent by server side, server is waiting for ACK instead of continuing sending next segments (as it should use sliding window principle). The client sends ACK after 40 ms, only then server sends the rest of responses packed into one segment. The 40 ms is a big delay and causes reponse processing to be 10 times slower.
The thing doesn't happen, if we move client to another host. In that case the server don't wait for ACK, don't pack responses and also response processing is much faster.
It seems, like on loopback the Nagle's alg. is still acting (citate from alg. description says:"a first segment is sent immediately, while further data on the sender side is buffered until either a full maximum segment can be sent or an acknowledgement for the first segment is received)
I found some descriptions of the same problem, but with no solution!
Is there a bug in setsockopt()? We are using 2.6.5 kernel.
Regards,
Mihal
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Setting TCP_NODELAY doesn't disable Nagle's alg. on loopback
2006-05-16 8:50 Setting TCP_NODELAY doesn't disable Nagle's alg. on loopback Radko Mihal
@ 2006-05-16 16:16 ` Stephen Hemminger
2006-05-16 20:53 ` David S. Miller
0 siblings, 1 reply; 3+ messages in thread
From: Stephen Hemminger @ 2006-05-16 16:16 UTC (permalink / raw)
To: Radko Mihal; +Cc: netdev
On Tue, 16 May 2006 10:50:30 +0200
"Radko Mihal" <rmihal@pobox.sk> wrote:
> Hi,
>
> We are facing strange problem with disabling the Nagle's algorithm via setting the TCP_NODELAY flag on server socket (setsockopt), where server is communication with client via loopback.
> After the first segment (of the response) is sent by server side, server is waiting for ACK instead of continuing sending next segments (as it should use sliding window principle). The client sends ACK after 40 ms, only then server sends the rest of responses packed into one segment. The 40 ms is a big delay and causes reponse processing to be 10 times slower.
>
> The thing doesn't happen, if we move client to another host. In that case the server don't wait for ACK, don't pack responses and also response processing is much faster.
>
> It seems, like on loopback the Nagle's alg. is still acting (citate from alg. description says:"a first segment is sent immediately, while further data on the sender side is buffered until either a full maximum segment can be sent or an acknowledgement for the first segment is received)
>
> I found some descriptions of the same problem, but with no solution!
> Is there a bug in setsockopt()? We are using 2.6.5 kernel.
If it is 2.6.5 that is over 2+ years old. Please try with something past the Pleistocene era...
More likely, you mean 2.6.15 and you are seeing the effect of TCP ABC. ABC is appropriate byte count
and it penalizes applications that do small sends. The correct fix is to change your application
to use TCP_CORK or do consolidation with writev(), sendmsg(), etc. This came up with the Java
debugger, see mailing list archives.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Setting TCP_NODELAY doesn't disable Nagle's alg. on loopback
2006-05-16 16:16 ` Stephen Hemminger
@ 2006-05-16 20:53 ` David S. Miller
0 siblings, 0 replies; 3+ messages in thread
From: David S. Miller @ 2006-05-16 20:53 UTC (permalink / raw)
To: shemminger; +Cc: rmihal, netdev
From: Stephen Hemminger <shemminger@osdl.org>
Date: Tue, 16 May 2006 09:16:06 -0700
> If it is 2.6.5 that is over 2+ years old. Please try with something
> past the Pleistocene era...
R O F L!
If that doesn't belong in a quotes file, I don't know what
does :-)
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2006-05-16 20:53 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-05-16 8:50 Setting TCP_NODELAY doesn't disable Nagle's alg. on loopback Radko Mihal
2006-05-16 16:16 ` Stephen Hemminger
2006-05-16 20:53 ` David S. Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).