I am using memcache for php sessions as defined below.
session.save_handler=memcache
; Defines a comma separated of server urls to use for session storage
session.save_path="tcp://10.x.x.x:11211?persistent=1&weight=1&timeout=1&retry_interval=15"
cat /etc/sysconfig/memcached
PORT="11211"
USER="memcached"
MAXCONN="2048"
CACHESIZE="128"
OPTIONS="-l 0.0.0.0"
I was doing load testing and noticed when executing the same script which connects to the database for a 1-2 second query. I then do mysql show processlist and I watch the connections go from sleep to running. After about 10-20 queries have executed all the sleeping queries drop off and the session is destroyed in memcache.
If I switch to file based sessions everything works as expected and the session does not get killed.
Memcache memory limit is 128mb of memory max connection 2048 port 11211
What could be causing this issue?
EDIT:
The session gets destroyed at exactly 30 seconds from the first request