Memcached and maximum persistent connections

dormando dormando at
Sat Oct 6 22:41:11 UTC 2007

64-per is a lot :)

Anyway, it's fine, go nuts. There's a comment next to the maxfiles section:
/* to limit connections-related memory to about 5MB */

... I have no idea how they arrived at this conclusion but it's not hard 
to figure out. The only things to keep in mind:

- There are small memory allocations per connection.
- They're not presently tracked by the global memory limit, so memcached 
will grow beyond that limit a wee bit based on your connections (and I'm 
not man enough to fix it instead of just repeating this).


Robin Schuil wrote:
> Hi all,
> I'm trying to run memcached but had some trouble with the connection 
> limit. Already found that I need to use the '-c <num>' option to 
> increase the # of maximum simultaneous connections. However, I have 200 
> webservers each with ~64 apache childs running (there may be peaks). If 
> each process would create a persistent connection that would mean that 
> each of my 10 memcached nodes have to handle 12,800 simultaneous 
> connections.
> I guess that shouldn't be a problem, but the low default maximum of 1024 
> somewhat bothers me. Is it sane to start memcached with a limit of 40K 
> connections, or is it likely that I'll run into other problems then?
> Your input is greatly appreciated.
> Thanks,
> Robin

More information about the memcached mailing list