Re: Load Balancing and PHP Sessions
| From: | J Smith | Date: | Fri, 26 Apr 2002 14:24:16 +0000 |
| Subject: | Re: Load Balancing and PHP Sessions | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-94734@lists.php.net to get a copy of this message | ||
A better way to set this up might be to use a reverse proxy in front of
www1.test.com and www2.test.com. Users would go to www.test.com and the
reverse proxy would forward communications between the front-end and the
servers in the back, thereby balancing the load. Cookies should still work
fine, regardless of the server that actually sets them. (I'm not sure if
PHP's built-in sessions would work...)
Since I'm assuming you're using Apache here, you'd most likely want to look
into using Squid, which is a kick-ass proxy. Setting up the re-director is
a bit of a hastle, since you basically have to write one from scratch, but
it isn't too difficult. (There are lots of pre-made ones that can handle
things like round-robins, randomness, all that jazz.)
J
Baumann Reto wrote:
> Is it possible to have sessions (via cookie) on a load balanced
> environment? Therefore having
> www1.test.com
> and www2.test.com
>
> and share the same sessions? The systems can access the same file-system,
> but it seems that the session is not passed. Could this have something to
> do with session.cookie_domain?
>
> Thanks for any help
>
> Reto