Re: transparent clusters + sessions
| From: | Richard Lynch | Date: | Thu, 18 Jul 2002 23:46:37 +0000 |
| Subject: | Re: transparent clusters + sessions | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-108384@lists.php.net to get a copy of this message | ||
>If I have say 20 web servers in a cluster behind something like a Cisco
>LocalDirector, will session data remain constant over the 20 web servers if
>they use a shared NFS or similar mount to save session data on?
Almost for sure, yeah, but NFS is probably not the best answer, unless you
know how to make NFS better than all the geeks I know who roll their eyes at
it. Hey, I've never even *seen* NFS, as far as I know, so it's all the same
to me...
Assuming you are already opening an SQL connection on most pages that need
sessions anyway, just stuff your session data into a single SQL back-end
database.
http://php.net/session_set_handler
has sample code for MySQL last time I looked, but porting that to any SQL
should be a five-minute + 1-hour testing job.
Oh yeah: The session_write happends *AFTER* the browser connection is long
dead. Write yourself a little error_handler and *LOG* all the boo-boos
instead.
http://php.net/set_error_handler
Even if you're *NOT* using SQL, it still might beat out NFS for
performance/reliability/scalability. You'll have to test on our hardware/OS
to be sure.
--
Like Music? http://l-i-e.com/artists.htm