perl-modperl mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Joshua Chamas <>
Subject Re: ANNOUNCE: Apache::ASP v1.93
Date Wed, 05 Jul 2000 22:59:36 GMT
Perrin Harkins wrote:
> On Wed, 5 Jul 2000, Joshua Chamas wrote:
> >  ++Better SessionManagement, more aware of server farms that
> >   don't have reliable NFS locking.  The key here is to have only
> >   one process on one server in charge of session garbage collection
> >   at any one time, and try to create this situation with a snazzy
> >   CleanupMaster routine.  This is done by having a process register
> >   itself in the internal database with a server key created at
> >   apache start time.  If this key gets stale, another process can
> >   become the master, and this period will not exceed the period
> >   SessionTimeout / StateManager.
> This sounds interesting, but I don't quite understand what you did.  The
> sessions are stored in a dbm file, right?  Don't you still need locking if
> all servers are trying to update the same NFS-mounted dbm file?  Or am I
> totally off on how session storage is implemented?

You might worry about this for concurrent writes to $Application,
or a framed application writing to $Session, so these are still
issues to worry about.

Its the session manager that was the big deal.  Before, there
was the possibility of 2 session managers running at the same
time, and a $Session would be killed twice, and have its 
Session_OnEnd executed twice, and possibly trip up some other
odd NFS file I/O errors, like deleting files that have already
been deleted.

Now, there is a bit of a write/read concurrency checking,
where a process on a server will attempt to promote itself
to the cluster session manager, by writing to the internal
database, and if that sticks a second later, it is promoted,
so we only have one process on one server in a web cluster
that is acting as the session manager at any time.  Note
that this is not a bottleneck generally because these promotion
attempts happen infrequently based on SessionTimeout and 
some rand()mness.

This will only work if the NFS attributes on the client
mount are set to no caching.

It seems to work great in 2 known web clusters.

-- Joshua
Joshua Chamas			        Chamas Enterprises Inc.
NodeWorks >> free web link monitoring	Huntington Beach, CA  USA                1-714-625-4051

View raw message