RE: php session_start dead lock

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We ran the checks and found no problems with the disks.   All disks are accessible, there are no I/O errors or disk access errors.   What has me bewildered is this started happening quite recently. If it's not hardware, then perhaps a new usage pattern is revealing a flaw in our php session handling code. 

 I have a suspicion it may be related our use of AJAX.   When a page is loaded in the browser we invoke PHP scripts asynchronously while another page may still be loading, which could cause two threads at the same time to want to lock the same session file in /var/tmp.  I am wondering if such a thing could result in a perpetual deadlock in php_flock when invoked from session_start.

We have a PHP script loading a page and from the page we have a javascript invoking another php script via Ajax which posts data that refreshes content dynamically via the DOM.

The script that is invoked via AJAX is not calling session_start, it is invoking session_id() only. Yet it works. It does reuse the same session id as we establish context with a database using it.  I am going to play with this and see if adding session_start before session_id() in the php script that is executed via AJAX may be involved.

When you said, there could be other things -  please share some other ideas.  perhaps others have seen this? as well as if anyone thinks this theory has validity.

 thank you.
 


-----Original Message-----
From: parasane@xxxxxxxxx [mailto:parasane@xxxxxxxxx] On Behalf Of Daniel Brown
Sent: Thursday, June 23, 2011 3:42 PM
To: Zaccone, Warren
Cc: php-general@xxxxxxxxxxxxx
Subject: Re:  php session_start dead lock

On Thu, Jun 23, 2011 at 15:27, Zaccone, Warren <wzaccone@xxxxxxxxxxxxx> wrote:
> We recently started experiencing a problem on our server (httpd 2.2.19, PHP 5.3.6) where all of the apache child processes hang in PHP code and no longer process requests.
>
>  I  am running Apache as prefork on Solaris 10 with 256 children, and found that within a few minutes all 256 httpd child processes are stuck, and it's always in the same place within php_session_start in a php_flock call.   Stack trace is shown below.
>
> The file it is trying to flock is  /var/tmp/sess_2e39aabaf226819b67f29da477892e91.

    May want to consider fsck'ing that drive, Warren.  You may have
some bad clusters that are causing disk I/O issues.  Just one of many
possibilities, of course, but the least favorite of all, obviously.


-- 
</Daniel P. Brown>
Network Infrastructure Manager
http://www.php.net/

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php




[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux