1) Use Transaction => 1 when tieing your session.
2) Make sure the session is untied after *every* request (i.e. even if a request is aborted, an error occurs in the middle, etc). Otherwise, when the next request tries to tie it it will block.
Dan McCormick wrote:
Hi,
I have an Apache 1.3.27/modperl 1.27 site using HTML::Mason 1.20 with MasonX::Request::WithApacheSession 0.23 on a Redhat 7.3 system. The site gets about 5,000 hits/day.
Each day, a few dozen httpds get stuck waiting for locks on the Apache::Session files. An lsof on the Apache pids reports things like this:
httpd 10956 root 11u REG 3,2 0 705177 /www/.../session_locks/Apache-Session-96d21c169d9c1d5490c04178fca08d8c.lock httpd 10956 root 22u REG 3,2 0 705177 /www/.../session_locks/Apache-Session-96d21c169d9c1d5490c04178fca08d8c.lock
and an strace reveals:
flock(11, LOCK_EX
I've set things up per the MasonX::Request::WithApacheSession docs and sample files, and I'm not doing anything particularly extraordinary with the sessions. Anyone have any thoughts on how I might fix the problem?
Thanks, Dan