I store my sessions with memcached. I am looking to detect how many active sessions there are currently.
I am convinced it must be possible – But I have googled and googled but to no avail so please stackoverflowers give me some guidence 🙂
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Memcached by nature isn’t meant to be used like that (it’s a fleeting cache store, it is not intended to do SQL / database like aggregate queries over), and current active sessions is usually not something I am remotely interested in (for load purposes, the hits & statistical data of the webserver is much more to the point).
If you are however use memcache only to store session-data (not other key-value pairs), you can use
getStats()to get an item count (cur_items) on the current memcache server.