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/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Codeigniter 3 session locking causing high number database connections (/showthread.php?tid=74995)



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?