简体   繁体   中英

PHP session lock issue

PHP Warning: session_start(): Unable to clear session lock record in /var/www/efs/html/v43/Api/PortalApi/PortalApi.php on line 39

When multiple request are made simultaneously, the above issue occurs in one of our dev environment but other environments are working fine. could not resolve the reason for it.

Your problem was the user concurrency.

Setting the following ini settings (also from PHP directly) can help to mitigate this issue on a high load project

I recommend disable session.lazy_write in php.ini

You can try this too:

ini_set('memcached.sess_lock_retries', 10);
ini_set('memcached.sess_lock_wait_min', 1000);
ini_set('memcached.sess_lock_wait_max', 2000);

We fixed the issue, the problem -> in a recent code change in dev environment multiple logs was added in the code for testing configuration, the writing of multiple logs directly to efs caused the slow down

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM