Details
-
Improvement
-
Resolution: Fixed
-
High
-
3.10.0, 3.9.4, 4.0.0
-
None
Description
As documented elsewhere, there are some php configs where gc_probability is set to 0 (notably debian).
The eZ session table will then grow continuously over time, and when the sysadmin sees that and clicks on "clean expired sessions" in the admin interface it is too late: deleting 3M rows from a table which is in constant use does not bode well with Mysql - most likely result is a very slooow ez for a couple of hours, followed by a rollback - and the table keeps growing...
Solution: delete the expired sessions X rows at a time, committing after every chunk (eg 1000 or 10000).
In order to do this:
- modify ezsession.php as per the attached file
- add an ini settings which specifies after how many session rows a commit should happen. I'd say 10000 is a good starting point, but of course admins can tune it according to their load
- modify module setup/session to pass the new ini param to eZSessionGarbageCollector()
Attachments
Issue Links
- relates to
-
EZP-12491 add a check for session.gc_probability during eZ setup
- Closed
-
EZP-15753 [placeholder] operations that should be deferred to cron
- Closed
-
EZP-10431 cronjob script to delete expired session
- Closed
-
EZP-13872 eZ Publish (cluster) scalability effort
- Closed
-
EZP-15745 allow ezdb::query() to return affected rows
- Closed