Mark T. Dame wrote:
> 
> 
> Yeah.  I forgot to mention that part.  I have all of my web directories
> (including the state directories) on NFS mounts since any given request
> can be handled by one of a number of physical servers.
> 

Keep SDBM_File then, as its the most NFS corruption tolerant.
You need to make sure that your NFS clients & servers are supporting
flock() correctly over the network, or it really not safe to run the
StateDir in this way, though it mostly works as you have found.
Also, make sure your NFS clients never cache or buffer the data,
then you will also have data sync issues.

To make sure your NFS are locking correctly, try this test,
common StateDir over NFS between 2 servers.  Have an ASP
script write something like:

<%= sprintf("%06d", $Application->{Count}++ )%>

Then hit the same script on 2 different servers with ab
for something like 1000 requests.  The final result should
be something near 2001 when you view it in a browser, if
its not, you do not have flock() locking supported
across the network.  I believe old NFS v2 did not do this
well, but that NFS v3 might, but have no real world experience
to back this up, just 2nd hand info.

If you want to continue with a StateDir approach, & NFS
does not get locking to work, then consider a samba mount.
Samba does support flock() locking on access to a network share.
If you have a NetApp, this might be a CIFS share instead.

If you want to abandon StateDir entirely, it is trivial to
wire up a custom $Session from an Apache::Session in Script_OnStart
for your application.  What you gain in RDBMS backed sessions,
but you lose the session management & expiration.

Regards,

Josh
________________________________________________________________
Josh Chamas, Founder                   phone:925-552-0128
Chamas Enterprises Inc.                http://www.chamas.com
NodeWorks Link Checking                http://www.nodeworks.com


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to