Hi,
I have recently installed memcache to handle my PHP sessions on a fairly busy site (100k/page views/day).
When I check the stats for it, I see there is about a 30% miss rate. Now since I don't use memcache for anything else - does that mean 30% of the time the user's session is failing?
I have put some debug tests in my code it does appear that some session variables are blank that shouldn't be occasionally.. but when I try and replicate it myself, I always 100% have the session.
I do have set session.use_only_cookies = 1 for other reasons, do you think the miss rate could be from users without cookies enabled or something?
Any help please! Many thanks.
Ian
Memcache PHP Sessions Miss Rate
Moderator: General Moderators
Re: Memcache PHP Sessions Miss Rate
I think so. Most probably you're running out of memcache memory and memcache starts to toss out least used keys (sessions). Try the following:IanD wrote:Now since I don't use memcache for anything else - does that mean 30% of the time the user's session is failing?
Code: Select all
telnet localhost 11211 #change localhost to hostname of memcache server
stats
Re: Memcache PHP Sessions Miss Rate
Thanks for the reply, I've ran the command and got the following:
There doesn't seem to be a 'STAT evictions' though?
Many thanks, Ian
Code: Select all
Connected to localhost.
Escape character is '^]'.
stats
STAT pid 23654
STAT uptime 78314
STAT time 1244658424
STAT version 1.1.13
STAT pointer_size 64
STAT rusage_user 22.537408
STAT rusage_system 39.322457
STAT curr_items 111744
STAT total_items 566863
STAT bytes 39635356
STAT curr_connections 1
STAT total_connections 607401
STAT connection_structures 68
STAT cmd_get 607419
STAT cmd_set 566863
STAT get_hits 422244
STAT get_misses 185175
STAT bytes_read 218413013
STAT bytes_written 155064863
STAT limit_maxbytes 67108864
ENDMany thanks, Ian
Re: Memcache PHP Sessions Miss Rate
Evictions are reported starting from v1.2.2 from what I know. Your version is quite old (released ~2.5 years ago). I'd recommend upgrading.