CodeIgniter Forums
Session: performance lock problem - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=11)
+--- Thread: Session: performance lock problem (/showthread.php?tid=70271)



Session: performance lock problem - alexhava - 03-16-2018

Hi all
I have turned on Memcache driver for sessions but got delay for a 5-20 seconds, page loading slow and with delays. I figured out that locks caused delay. I put session_write_close to the end of the scripts but that didn't help to solve the problem. How can I fix this?

Thanks


RE: Session: performance lock problem - alexhava - 03-16-2018

Hm, switched to redis and works just fine. It seems some problems with memcache extension.


RE: Session: performance lock problem - Narf - 03-19-2018

FYI, putting session_write_close() at the very end of script execution is useless - CI will do that on its own at that point.

If you do use it, it has to be at a point where you no longer need to read/write new session data, but more code is to be executed - thus, the lock is freed as soon as necessary while the rest of your code still executes.