?
avatar hotthemes
hotthemes
10 Feb 2018

Steps to reproduce the issue

Watch #_session table in PhpMyAdmin.

Expected result

#_session table should increase and decreases accordingly to the number of visitors on site.

Actual result

#_session table increases abnormally, even if no visitors are on site.

System information (as much as possible)

Database Version 5.6.38
Database Collation latin1_swedish_ci
Database Connection Collation utf8mb4_general_ci
PHP Version 7.1.14
Web Server LiteSpeed
WebServer to PHP Interface litespeed
Joomla! Version Joomla! 3.8.5 Stable [ Amani ] 6-February-2018 15:00 GMT
Joomla! Platform Version Joomla Platform 13.1.0 Stable [ Curiosity ] 24-Apr-2013 00:00 GMT

Additional comments

I am updating my site regularly (... 3.8.3 > 3.8.4 > 3.8.5). When I was checking its database, I had noticed abnormal increase of #_sessions table (it's over 500 megabytes!). I deleted all rows from this table using PhpMyAdmin. However, Joomla still adds rows to this table, almost every second.

"session_id" column is different for each row.

However, "data" column looks similar for each row. In example:

joomla|s:3000:"long_string_here";
joomla|s:664:"the_same_long_string_here";
joomla|s:3000:"the_same_long_string_here";
joomla|s:3000:"the_same_long_string_here";
joomla|s:2928:"the_same_long_string_here";
...

avatar hotthemes hotthemes - open - 10 Feb 2018
avatar joomla-cms-bot joomla-cms-bot - labeled - 10 Feb 2018
avatar hotthemes
hotthemes - comment - 10 Feb 2018

I will add that session handler is set to Database. Session time is set to 15 minutes.

Remember Me plugin is disabled.

I have latest versions of Kunena and AcyMailer installed on this site. In kunena, session time is set to 900 seconds.


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/19636.

avatar mbabker mbabker - change - 10 Feb 2018
Status New Closed
Closed_Date 0000-00-00 00:00:00 2018-02-10 15:42:27
Closed_By mbabker
avatar mbabker
mbabker - comment - 10 Feb 2018

See #19585 (comment) and other referenced items.

As for the data column contents, the data store is base64 encoded in a key named "joomla".

avatar mbabker mbabker - close - 10 Feb 2018
avatar joomdonation
joomdonation - comment - 10 Feb 2018

If your server has session.gc_probability setting set to 0 (Rochen has that setting, at least on my case PHP 7.2), you will need to setup cron job to clean up session meta data.

You can get this file, unzip it, upload to cli folder of your site, then setup a cron job to run that script (every 10 minutes for example) and the issue will be sorted

sessionGc.zip

avatar hotthemes
hotthemes - comment - 10 Feb 2018

I have a VPS and yes, session.gc_probability was set to 0. I changed it and set to 1.

I hope my #_session table won't have 100s of megabytes tomorrow. ;)

avatar joomdonation
joomdonation - comment - 10 Feb 2018

You might want to change session.gc_probability value to a higher number than 1, depends on the traffic of your site and the value of session.gc_divisor. From PHP documentation:

session.gc_divisor coupled with session.gc_probability defines the probability that the gc (garbage collection) process is started on every session initialization. The probability is calculated by using gc_probability/gc_divisor, e.g. 1/100 means there is a 1% chance that the GC process starts on each request. session.gc_divisor defaults to 100.

Add a Comment

Login with GitHub to post a comment