1

I recently migrated a system from an Ubuntu 12 based four-webserver setup to an Ubuntu 16 three-webserver setup in a new data centre . The system uses memcache for the session handler. The session is used to determine whether a user is logged in or not and which user is logged in. It worked perfectly on the Ubuntu 12 setup.

On the new Ubuntu 16 setup, every now and then when I login, I get immediately logged out (session disappears). The system also allows me as an administrator to switch between users (which basically changes the session data to the new selected user). When I do this, sometimes it will switch back to the old user when I navigate to another page.

This all sounds to me like the memcache session is not working 100% and I sometimes get old session data, either from when I was logged out, or when I was a different user.

How do I debug this to determine what the problem is? My google searches have found how to debug memcached but not memcache

Here is the relevant config from php.ini :

session.save_handler = memcache
session.save_path="tcp://10.32.82.2:11211?persistent=1&weight=1&timeout=1&retry_interval=15,tcp://10.32.82.3:11211?persistent=1&weight=1&timeout=1&retry_interval=15,tcp://10.32.82.4:11211?persistent=1&weight=1&timeout=1&retry_interval=15"

Here is the relevant config from memcache.ini :

extension=memcache.so

[memcache]
memcache.dbpath="/var/lib/memcache"
memcache.maxreclevel=0
memcache.maxfiles=0
memcache.archivememlim=0
memcache.maxfilesize=0
memcache.maxratio=0
memcache.allow_failover=1
memcache.session_redundancy=4
1
  • (For the benefit of other people that hit this question).... I too don't know how to debug memcache... But I would suggest that if you have 4 memcache servers - your memcache.session_redundancy should be 5, not 4 (yes, I know... go figure)
    – Meh-Lindi
    Aug 8, 2018 at 7:54

0

You must log in to answer this question.

Browse other questions tagged .