CodeIgniter Forums
Codeigniter 3 session locking causing high number database connections - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forum-5.html)
+--- Forum: General Help (https://forum.codeigniter.com/forum-24.html)
+--- Thread: Codeigniter 3 session locking causing high number database connections (/thread-74995.html)



Codeigniter 3 session locking causing high number database connections - blasto333 - 12-04-2019

In codeigniter 3 sessions using mysql driver. SELECT GET_LOCK(sess,300) is called to prevent scripts from modifying session data at same time.

This works fine until a user goes crazy and makes a bunch of requests causing all of these connections to pile up and eventually slow down database until they are all released

1. If I use redis, files, or memcached driver, will this take load off database? How do these drivers lock? Which backend is recommend for ALB with 4 web servers?

2. Is there a sane way to stick with database driver and prevent query pileup?