|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #63716 improved session locking control through php.ini
Submitted: 2012-12-07 10:59 UTC Modified: -
From: marc dot neudert at gmail dot com Assigned:
Status: Open Package: memcache (PECL)
PHP Version: Irrelevant OS: irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
From: marc dot neudert at gmail dot com
New email:
PHP Version: OS:


 [2012-12-07 10:59 UTC] marc dot neudert at gmail dot com
The session locking introduced with pecl-memcache-3.0.4 uses a steadily 
increasing wait time (from 5ms up to 1000ms) until the session is unlocked.

When sending several parallel AJAX requests (or lots in fast succession), you 
often end up at the max waiting time of 1000ms. This could make apps somewhat 
unresponsive if they are heavily AJAX dependent.

@see #22462
@see #58726

Test script:

  $session = session_start();
  usleep(100000); // sleep 100 ms


<script language="text/javascript">
for (var i = 0; i < 10; i++) {
  xmlhttp=new XMLHttpRequest();"GET","http://localhost/session_lock.php?"+i,true);

Expected result:
In an optimal case (and without using session_write_close()) each of the 10 AJAX 
requests would be executed once the previous one is finished. Therefore taking 
around 1.x seconds for all 10 requests.

Actual result:
Due to the increasing locking wait times the total time taken is far beyond that 
(depending on the server you could expect 5s total).


session-locking-php.ini-configuration (last revision 2012-12-07 11:00 UTC by marc dot neudert at gmail dot com)

Add a Patch

Pull Requests

Add a Pull Request

PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Sat Sep 21 23:01:27 2019 UTC