Using memcached 1.4.15
 
Over the past few months I've been having a few issue with memcached, 
notably the issue here: 
http://code.google.com/p/memcached/issues/detail?id=260
 
However, another, maybe related issue, is that once every few days, clients 
(websites running PHP) cannot connect to the localhost memcached instance.
 
I'm running with a connection limit of 4096:
memcached -d -p 11211 -m 1024 -c 4096 -P /var/run/memcached/memcached.pid 
-l 127.0.0.1 -k
 
When the error started happening today, I looked at the log and see several 
"Too many open connections" lines.  Here's the first one:
...
>4094 Writing bin response:
...
<4094 connection closed.
Too many open connections
...
 
Connection #4094 is right around my 4096 connection limit...
 
Looking at netstat and lsof, I see around 4000 connections -- most of them 
are in CLOSE_WAIT.
 
lsof:
...
memcached 477 root 1366u  IPv4          622713568        0t0       TCP 
localhost:memcache->localhost:43324 (CLOSE_WAIT)
memcached 477 root 1367u  IPv4          622713571        0t0       TCP 
localhost:memcache->localhost:43325 (CLOSE_WAIT)
...
 
netstat:
...
tcp       39      0 localhost:memcache          localhost:45768             
CLOSE_WAIT
tcp       25      0 localhost:memcache          localhost:42766             
CLOSE_WAIT
...
 
The rest of the connections are in FIN_WAIT1, ESTABLISHED, etc, but the 
vast majority are the ~4,000 CLOSE_WAIT connections.
 
I'm going to try bumping up the connection limit to 32k to avoid this for 
now, but clearly there's something going on where memcached isn't closing 
connections.
 
How can I debug this further?

-- 

--- 
You received this message because you are subscribed to the Google Groups 
"memcached" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to memcached+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to