Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2007
    Location
    Coventry, UK
    Posts
    348

    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

  2. #2
    Join Date
    Mar 2005
    Location
    Europe
    Posts
    74
    I would recommend to track sessions using your custom application and keep them in a database.
    Hovewer a dedicated hardware load balancer would be better.

  3. #3
    Join Date
    Feb 2004
    Posts
    634
    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.

  4. #4
    Have not done it but some use memcached to store sessions.

    Cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •