ufairiya / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

idea for improved keep-alive performance #68

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I found the reason for the poor keep-alive performance.
It is a well known problem with the Nagle algorithm on Linux.
For instance Apache sets the TCP option TCP_NODELAY for all sockets.
Futhermore the Linux implementation is very sensitive to the sequence 
order of read/write socket operations.
sources:
  http://www.stuartcheshire.org/papers/NagleDelayedAck/
  http://articles.techrepublic.com.com/5100-10878_11-1050878.html#

Btw: I just retested my keep-alive tests with a patched (TCP_NODELAY 
option set) svn version of r429.
And, performance is great! Twice at fast! And with many threads three 
times as fast. Now mongoose is CPU bound (which is good for a server under 
performance stress) and does not spend time in unaccountable system calls.

Original issue reported on code.google.com by Mario.Kl...@googlemail.com on 2 Jul 2009 at 12:30

GoogleCodeExporter commented 9 years ago
That explains why keep-alive sucked only on Linux, not on other OSes. Thank you 
for
the tips!
However, this will not make me putting keep-alive back :-)

Original comment by valenok on 5 Jul 2009 at 1:07