php.net |  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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
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
Description:
------------
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:
---------------
server-side:

<?php
  $session = session_start();
  usleep(100000); // sleep 100 ms
?>

client-side:

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

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).

Patches

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: Mon Oct 14 15:01:26 2019 UTC