Php – Shared PHP Sessions in Load Balanced httpd environment

high-availabilityhttpdload balancingPHP

I have two httpd servers running PHP on RHEL 5.7. Initially I was sharing PHP sessions between the servers using a common NFS share that was hosted on a third server. This was causing slow downs and eventually hangups on the httpd servers.

What is the best practice for sharing PHP session data between multiple httpd front end servers?

The vendor is recommending that I leverage load balancing connection persistence via a cookie or source IP, but I am concerned that a failure in one of the httpd servers will cause users to lose their session data and be logged out (for example).

Thoughts?

Thanks!

Best Answer

Either put your sessions into your (hopefully replicated) database, or use replicated memcached servers for your sessions.