general load balancing issues

Tim Kientzle kientzle at acm.org
Mon Dec 15 12:33:21 PST 2003


On Mon, 15 Dec 2003, Matthew Seaman wrote:
>On Mon, Dec 15, 2003 at 12:46:52PM +0100, Bogdan TARU wrote:
>
>> I am wondering, though, if I will be able ...  to load-balance the domains
>> involving sessions: will the sessions be lost when connsecutive hits
>> go to different webservers, or not? 

It depends on where you store the session info, of course.
I'm not as familiar with PHP, but I know that Java servlets/JSP
default to storing all session info in RAM, which does glue
each session to a particular server.

Check the load-balancer you're using and see if handles
"session persistence."  In a nutshell, this gaurantees that
successive requests from the same user always
go to the same server.  This approach has its drawbacks,
but it works pretty well in practice.

>The canonical answer to this is to store the session data in the
>back-end database, so that it's accessible to all of your servers.

This depends a lot on the level of traffic you're trying to
support.  For <100 dynamic pages/second, this is pretty straightforward;
I've prototyped systems that could top 10,000 dynamic pages
per second using a shared session server, but very few people
need that kind of performance.

Tim Kientzle



More information about the freebsd-hackers mailing list