Re:In-memory key-value store in C, Go and Python
by caf on Friday March 23, 2012 @10:37PM
(#3748285)
It could be the Nagle algorithm - setting the TCP_NODELAY socket option on the sender would be one way to test.
[ Parent
| on HN ]
Re:In-memory key-value store in C, Go and Python
by graham_king_3 on Saturday March 24, 2012 @08:33PM
(#3751285)
Yes, thank you! Adding this line to the two-writes Python version (memg-slow.py on github) makes it about as fast as the single write version (memg.py on github):
sock.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
It's an interaction between delayed ACKS and the Nagle algorithm, mentioned on the Nagle algorithm wikipedia page.
I'm learning a lot this week. Thanks again.