I'm using HHVM to serve up my PHP content, and have a memcached
instance setup with a view to using it as a save handler for sessions, however I'm not sure that HHVM is actually using it.
Here's the relevant part of /etc/hhvm/php.ini
:
session.save_handler = memcached
session.save_path = /tmp/memcached.sock
memcached.sess_prefix = 'php_'
Note; I had to use a session.save_handler
value of memcached
rather than memcache
as used in vanilla PHP. I also had to set a memcached.sess_prefix
otherwise I was getting errors about it being empty.
However, if I connect to memcached
and request its statistics, it doesn't look as if any sessions are being stored in memcached
at all.
Here are the stats for hits/misses:
STAT get_hits 15
STAT get_misses 29
The memcached
daemon has been running for several weeks uninterrupted, so these values seem extremely low. In fact I suspect they were probably generated when I briefly used a vanilla PHP installation before switching to hhvm
.
There are no errors in /var/log/hhvm/error.log
pertaining to memcached, or sessions, so it doesn't appear to be failing to connect, which suggests that it simply isn't trying. Though if that's the case I have no idea how sessions are being stored as they don't seem to be going into /tmp
, but they do appear to work (does HHVM/PHP store any session data in RAM itself?)
Everything seems like it's configured correctly, is there something else that I need to change?