Words of wisdom about using the Memcached UDP protocol?

Reinis Rozitis roze at roze.lv
Wed Jan 31 04:29:22 UTC 2007

"300*13*13 = 50,700 TCP connections"

The math and the numbers seem a bit wrong to me - its not like those 50k 
connections will handle one server will it? :)
So practically if you are using persistant connections one server has to 
handle at most 13*300 = 3900 connections (the same goes for memcached and 
http servers - eg each of the preforked daemon connects to each memcached, 
each memcached recieves only one connection from each preforked perl 
daemon - if I understand your architecture correctly) which is no issue for 

And if you are looking at libevent benchmarks (on epoll) 
http://monkey.org/~provos/libevent/ there is no big difference timewise.

>From our experience we are using 8 webservers with spawned 250 php fastcgi 
childs on each and connecting to 3 memcached servers. Although we dont use 
persistant connections more likely we will hit bandwidth limitations 
(transfering allready few Tb per day) from a single host (on a gigabit lan) 
than some tcp connection limits.

I cant comment the UDP feature as the php extension doesnt support it.

I would preffer to use the latest 1.2.1 version. It works better for us at 

----- Original Message ----- 
From: "EKC" <webmaster at generalsynthesis.com>
To: <memcached at lists.danga.com>
Sent: Wednesday, January 31, 2007 5:04 AM
Subject: Words of wisdom about using the Memcached UDP protocol?

> Hello,
> I've got 200 preforked http daemons (light weight http server written
> in Perl) running on each of 5 servers in a memcached pool.  I'm
> planning on upping that to 13 servers and 300 http daemons per server
> (quad core opteron systems).
> Needless to say, I am starting to worry about the saneness of keeping
> all of those connections open for memcached (300*13*13 = 50,700 TCP
> connections). I was perusing the Memcached protocol doc at
> http://code.sixapart.com/svn/memcached/trunk/server/doc/protocol.txt
> and the description of the UDP protocol caught my eye.
> I can rewrite my app to tolerate some datagram loss. Tornado codes are
> an option, too. I'm a bit worried about network congestion, but I
> suppose I could tweak some switch settings to deal with that.
> However, is anyone actually using Memcached over UDP in a large scale
> deployment? If so, are you still using TCP for set requests, or have
> you moved over to UDP entirely? I recall reading that Facebook uses
> memcached and I'm guessing they may have though about using UDP, too.
> Any words of wisdom?
> I'm using the perl API which does not seem to support UDP, so I will
> have to do a fair bit of refactoring to move over to UDP.
> Finally, which branch of the Memcached server daemon should I be using
> if I'm going to be using UDP? I head about a multithreaded version of
> the memcached daemon. Should I move over to that or is the overhead
> not worth it?
> ...
> I'm using memcached 1.1.13-pre from
> http://code.sixapart.com/svn/memcached/branches/facebook/
> Thanks in advance!

More information about the memcached mailing list