Re:In search of performance – how we shaved 200ms off every ...
by geofft on Thursday August 20, 2015 @04:35PM
(#10094487)
What are the cases where you want Nagle's algorithm enabled? It seems like the primary use case is telnet and telnet-like services (like SSH), but even there, Mosh does much better at balancing performance against congestion. For non-interactive protocols, do you ever want Nagle's algorithm?
[ Parent
| on HN ]
Re:In search of performance – how we shaved 200ms off every ...
by toast0 on Thursday August 20, 2015 @10:52PM
(#10095745)
Nagle's algorithm would actually help in this case, if there were a bit more data to send, since ruby is passing data bits at a time, buffering it until you get a full packet would be nice. It's just the first bit is sent right away, and the second bit doesn't fill the packet, and there is no third bit. If you were pipelining reuests, the algorithm would be helpful.
Re:In search of performance – how we shaved 200ms off every ...
by geofft on Thursday August 20, 2015 @11:48PM
(#10095883)
But the client code already has information about whether it's planning to write some more or not, so you could just depend on that, instead of using heuristics about the peer's behavior. Even regular stdio-style buffering plus an explicit flush would help more than Nagle's algorithm.
Re:In search of performance – how we shaved 200ms off every ...
by toast0 on Friday August 21, 2015 @02:27AM
(#10096220)
The client doesn't always have that information (especially if you're doing Unixy things and piping through netcat), but when it knows, it should certainly indicate that, which is why there's TCP_NODELAY and friends; I couldn't find out exactly when TCP_NODELAY showed up, but old BSD man pages [1] have the option and a date in 1986. In the absence of explicit information from the client, I think Nagle's algorithm is a decent heuristic.
[1] https://www.freebsd.org/cgi/man.cgi?query=tcp&apropos=0&sekt...