PHP sessions in a load balancing cluster - how?

后端 未结 10 1983
粉色の甜心
粉色の甜心 2020-11-29 17:44

OK, so I\'ve got this totally rare an unique scenario of a load balanced PHP website. The bummer is - it didn\'t used to be load balanced. Now we\'re starting to get issues.

10条回答
  •  我在风中等你
    2020-11-29 18:29

    If you are using php sessions you could share with NFS the /tmp directory, where I think the sessions are stored, between all the servers in the cluster. That way you don't need database.

    Edited: You can also use an external service like memcachedb (persistent and fast) and store the session info in the memcachedb index and indentify it with a hash of the content or even the session ID.

提交回复
热议问题