Home > OS >  PHP session lock issue
PHP session lock issue

Time:04-21

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.

CodePudding user response:

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

CodePudding user response:

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

  • Related