Jump to content


Photo

How to keep session data in multiple Apache servers?


  • Please log in to reply
1 reply to this topic

#1 william_rao

william_rao
  • New Members
  • Pip
  • Newbie
  • 1 posts

Posted 18 November 2003 - 12:32 AM

We plan to install multiple Apache servers instead of single Apache server since it is overloaded. My concern is: in one user session, the user may send 2 or more requests. How do multiple Apache servers to communicate each other for the same session?

For example, we have Apache Server A and Apache Server B. A and B process user shopping cart requests in turn, but connect to the same database. User William wants to buy a PC and a notebook (just like in Dell.com). He login to the PHP shopping cart. First he puts a PC into his shopping cart, this request is processed by Apache Server A. Then, in same session, he puts a notebook into his shopping cart, this request is processed by Apache Server B. How can Apache Server B knows user William has a PC in shopping cart so B can calculate the total price for a PC plus a notebook?

Thanks a lot.

#2 sirmanson

sirmanson
  • Members
  • PipPip
  • Member
  • 16 posts
  • LocationTucson, AZ USA

Posted 19 November 2003 - 04:09 PM

The easiest way to make this work is just to use a common database between the two servers. Have all of your user session data stored here. Then either server can access the data at any time.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users