We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

Memcache / Memcached on multiple servers

Hello!

I'm using Memcache with two memcached servers running on two different IP adresses. In the php.ini, I can assign Memcache to write to both these servers for session redundancy, but with the Phalcon Memcache adapter, I can only point out one IP as the host, which in turn makes is to that if you log in to the site and the load balancer then switches you to our other server, your session will not exist and you'll be thrown out.

How do I use Phalcon's Memcache adapter to write to all servers hosting my memcached deamons, as defined in the php.ini-file?

Thank you.



22.6k
Accepted
answer
edited Oct '14

Cool! Thank you!

The Libmemcached actually has a dedicated Session implementation. This solved the issue: \Phalcon\Session\Adapter\Libmemcached.

Thank you for pointing me in the right direction!



58.4k

Glad you got it working :)