Memcache? This is great but I am a bit concerned with what happens if the server crashes? I would lose that partition of sessions with the crash because from what I understand Memcache is not distrubuted. Can I make it distrubuted? ( I was just told that I can use pecl memcache module >= 3
Estou usando o repcached . É iniciado como abaixo:
-
no servidor 1:
memcached -d -p 11211 -u memcached -m 64 -c 1024 -P /var/run/memcached.pid -x <server2_ip>
-
no servidor 2:
memcached -d -p 11211 -u memcached -m 64 -c 1024 -P /var/run/memcached.pid -x <server1_ip>
Configuração para a extensão PHP Memcache:
extension=memcache.so
memcache.allow_failover = 1
memcache.redundancy = 1
memcache.session_redundancy=2
memcache.hash_strategy = consistent
E o manipulador de sessão em php.ini
:
session.save_handler = memcache
session.save_path="tcp://ip1:11211, tcp://ip2:11211"