PHP Sessions in Load Balanced Enviroment, Database or NFS?
We have setup and are currently testing a load balanced cluster using heartbeat and ldirectord. One of the problems we have come across is that we are unable to reliably use the same web server for connections from the same user. As a result the php sessions are getting in a bit of a muddle.
Obviously its not something that we can easily sync between servers like the customers other web content. We are looking at either storing the sessions in a database or NFS. The site is pretty busy and we are a bit worried that when the site goes live both these options will slow everything down.
Apart from using different load balancing software is there any other solutions we could use for this? Has anyone stored php sessions in a database on a busy site or on a NFS?
UK Dedicated Servers since 2003 www.ukservers.com - 0800 610 1 620
I wouldn't recommend an NFS mount or file-based session storage for a site that has anything but light traffic patterns or a small number of users; NFS doesn't have the fine-grained concurrency for that sort of thing and you will likely have session issues. Using database-backed sessions shouldn't lead to much of a performance issue if done properly.