You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl@perl.apache.org by Greg Cope <gj...@rubberplant.freeserve.co.uk> on 2000/05/13 02:43:36 UTC

Re: speed up/load balancing of session-based sites - POT

POT = Possibly Off topic

<snippage>
: Likewise with sessions. Even if you load balance across multiple machines
: you don't need to access a session database on every request. Most load
: balancing systems have something so they'll send the seme "session"
: (typically ip address) to the same backend server for N seconds as long as
: the backend server is up of course.
:
: You can then put a daemon on each backend server as a local buffer and
: cache between the httpds and the session database. This daemon can even
: load balance the session information over several databases if it's
: needed.
:
: viola, a lot less "real time" lookups in the database needed and a lot
: less direct connections.

ironically I was thinking the same thing today (I may need to load ballance
3 webservers to one DB server).

But - is this model not transaction safe ? - It may save alot of DB use and
hence be alot quicker - but what if the webserver "disappears" halfway
through an IP based load ballanced "sesssion" - a potential source of
failure - something which a load ballancer is supposed to help with..

Also if the loadballance goes south, and a secound takes over does it have
the same IP based session info (probably not - but could be wrong ...) -
hence another potential source of failure.

If your model can accept this then fine - but this would not work in a
{few|many} ecomerce apps as session management is critical.

What do you think ?

Greg Cope
:
:
:  - ask
:
: --
: ask bjoern hansen - <http://www.netcetera.dk/~ask/>
: more than 70M impressions per day, <http://valueclick.com>
:
:


Re: speed up/load balancing of session-based sites - POT

Posted by Greg Cope <gj...@rubberplant.freeserve.co.uk>.
From: "Perrin Harkins" <pe...@primenet.com>
To: "Greg Cope" <gj...@rubberplant.freeserve.co.uk>
Cc: <mo...@apache.org>
Sent: 13 May 2000 01:57
Subject: Re: speed up/load balancing of session-based sites - POT


: On Sat, 13 May 2000, Greg Cope wrote:
: > : Likewise with sessions. Even if you load balance across multiple
machines
: > : you don't need to access a session database on every request. Most
load
: > : balancing systems have something so they'll send the seme "session"
: > : (typically ip address) to the same backend server for N seconds as
long as
: > : the backend server is up of course.
: > :
: > : You can then put a daemon on each backend server as a local buffer and
: > : cache between the httpds and the session database. This daemon can
even
: > : load balance the session information over several databases if it's
: > : needed.
: > :
: > : viola, a lot less "real time" lookups in the database needed and a lot
: > : less direct connections.
: [...]
: > But - is this model not transaction safe ? - It may save alot of DB use
and
: > hence be alot quicker - but what if the webserver "disappears" halfway
: > through an IP based load ballanced "sesssion" - a potential source of
: > failure - something which a load ballancer is supposed to help with..
: >
: > Also if the loadballance goes south, and a secound takes over does it
have
: > the same IP based session info (probably not - but could be wrong ...) -
: > hence another potential source of failure.
:
: You have to do a write-through cache, i.e. you must write to the database
: as well as the cache, but you only have to READ the database if you don't
: find the session in the cache.  If you have a fair amount of read-only use
: of the session this can be a big win.

Ok - but I find that most of my session stuf updates a "last access"
atribute within the session and hence is mostly read + write - not just read
but YMMV - good point tho.

Greg

:
: - Perrin
:
:


Re: speed up/load balancing of session-based sites - POT

Posted by Perrin Harkins <pe...@primenet.com>.
On Sat, 13 May 2000, Greg Cope wrote:
> : Likewise with sessions. Even if you load balance across multiple machines
> : you don't need to access a session database on every request. Most load
> : balancing systems have something so they'll send the seme "session"
> : (typically ip address) to the same backend server for N seconds as long as
> : the backend server is up of course.
> :
> : You can then put a daemon on each backend server as a local buffer and
> : cache between the httpds and the session database. This daemon can even
> : load balance the session information over several databases if it's
> : needed.
> :
> : viola, a lot less "real time" lookups in the database needed and a lot
> : less direct connections.
[...]
> But - is this model not transaction safe ? - It may save alot of DB use and
> hence be alot quicker - but what if the webserver "disappears" halfway
> through an IP based load ballanced "sesssion" - a potential source of
> failure - something which a load ballancer is supposed to help with..
> 
> Also if the loadballance goes south, and a secound takes over does it have
> the same IP based session info (probably not - but could be wrong ...) -
> hence another potential source of failure.

You have to do a write-through cache, i.e. you must write to the database
as well as the cache, but you only have to READ the database if you don't
find the session in the cache.  If you have a fair amount of read-only use
of the session this can be a big win.

- Perrin