[patch] Memcached UDP
Tomash Brechko
tomash.brechko at gmail.com
Sun Dec 16 15:04:22 UTC 2007
On Sat, Dec 15, 2007 at 22:45:05 +0300, Anton Yuzhaninov wrote:
> Patch from Vsevolod Stakhov to fix 2 bugs in memcached udp protocol support:
> - some (not correct) requests may crash (sig11) memcached
> - cleanup was not performed for tcp.
> http://cebka.pp.ru/blog_en/2007/12/memcached-udp.html
Here's the translation of memcached relevant stuff on that page:
* Memcached UDP (2007-12-07)
Though memcahced formally supports UDP, I wouldn't recommend using
it. If you send memcached an UDP packet with the garbage in the
header, the server may crash. Moreover, even if you are sending
correct packets, after some time the server starts to "recollect"
the pieces of the old packets, because memcached fails to clear the
receive buffer. I'm trying to fix these bugs, and if everything
goes well, there will be a patch for the server, together with the
client library that does UDP (as well as TCP; the main goal is the
thread-safe client library). Using UDP to retrieve many small keys
should be much faster.
Test results:
UDP:
Results of memcached stress test:
Total number of connections: 10000
Number of seconds for test: 2.23
Number of successful connections: 10000
Connections per second: 4494.25
TCP:
Results of memcached stress test:
Total number of connections: 10000
Number of seconds for test: 4.38
Number of successful connections: 10000
Connections per second: 2280.87
During the test there were 100 concurrent connections each executing 3
commands for corresponding key: set, get, delete.
* Memcached UDP fix (2007-12-13)
This patch fixes the problem with UDP that caused server crash on
bogus packet header, as well as clearing the receive buffer on bogus
command on not found key.
http://cebka.pp.ru/blog/patch-memcached-udp
EOF
I'd like to add that test results cited above seem to include the time
of the TCP connection establishing, so 2x speedup is not a surprise
for 3 commands per each new connection. Still, it seems the patch
fixes the real problem.
--
Tomash Brechko
More information about the memcached
mailing list