php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #72664 accessing session is very slow when ajax request
Submitted: 2016-07-24 15:24 UTC Modified: 2016-07-24 19:14 UTC
From: saravanan dot swaminathan at kgfsl dot com Assigned:
Status: Not a bug Package: Session related
PHP Version: 7.0.9 OS: Linux
Private report: No CVE-ID: None
 [2016-07-24 15:24 UTC] saravanan dot swaminathan at kgfsl dot com
Description:
------------
If I write data into session through ajax request, it takes more than 1 minute. If I trigger other javascript functions through other control, it return response quickly.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-07-24 19:08 UTC] yohgaki@php.net
-Status: Open +Status: Not a bug
 [2016-07-24 19:08 UTC] yohgaki@php.net
Session data is locked while it is accessing. i.e. Access to resources is serialized.

If you would like to speed up, increase parallelism by using read only access (available since 5.6) or commit (session_commit) as soon as you don't need to update it.
 [2016-07-24 19:14 UTC] yohgaki@php.net
Beware that improper parallelism causes session data inconsistency. 

e.g. Open&Read session data and write&close session. Later on, session data is needed to be updated, so open&read and write&close again based on state that script is running. This kind of code may cause race condition (= inconsistency depends on execution order/state/etc)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 03:01:27 2024 UTC