> I am running memcache on an Amazon EC2 "large" instance (7.5GB RAM, 64 bit, > high i/o, etc). Is there a way to compute the optimum amount of > storage space and number of connections? I ask because I am right now using > a pulled-out-of-thin-air startup of: > /usr/bin/memcached -d -r -u nobody -m 7000 -c 4096 > > When we get enough (I'm not sure what enough is exactly - either max > connections or close to it), memcache stops responding entirely. You > try to telnet to port 11211 and it just hangs. I have to reboot the box when > this happens. Obviously sub-optimal.
How are you verifying this situation? The *box* is hung or memcached is hung? Is the box swapping, if you can get in can you kill memcached and restart it, etc? > Is this expected behavior? I would have hoped to just get a quick > "connection refused", instead it gums up the connecting apache processes > for a long time, which is not good. Even better, I would like to find some > way to avoid running out of connections. If I can only get 3000 > connections with this configuration then so be it, I'll just add more nodes. > Would really like to know for sure one way or the other > though. No... If you have to reboot the box legitimately, you're probably just swapping and need to lower the max memory limit. -m 6500 or whatever. A lot of other things are discussed here: http://memcached.org/timeouts If it turns out you're just hitting maxconns; try increasing -c further (perhaps also lowering -m by a few megs), or try the new "-o maxconns_fast" option in 1.4.9+, which immediately rejects conns over the limit. -Dormando
