I had a site on my server which was running low on disk space.
It’s a small site, so but investigating, I found it was the database which was taking up 1.4GB.
The table causing this was Modx_session
I have logged out all users, which clears the table down, but I don’t understand why it’s growing so large.
I have several sites on the same server - all of which have similar traffic - but the Modx_session table is only 50MB or so.
The only difference I can see is the site in question has ben ‘hardened’ in terms of security - so the Core folder is above the main public_html folder.
Could this be the reason why the sessions table isn’t being emptied?
Right - Presumably this is to see how old the oldest session is?
Well I guess I was a bit stupid - because I flused the tale manually already - but this is the smallest value in there now:
1633940740
But if that value relates to the ages of the session that that doesn’t help as it was flushed this morning. Doh…
That’s common, about 1 in 3 sites in SiteDash have that and that’s why that has a remote session clearing functionality
The root cause is the server is optimized to not run the garbage collector normally, but through a cron job. However MODX doesn’t store sessions in the default location, but in the database, which that cron doesn’t know about.
To fix it the PHP.ini setting session.gc_probability needs to be set back to 1 instead of 0. Or connect the site to SiteDash.
Thanks Mark.
I don’t have an php.ini file in the site directory (it’s just using default settings from the server) so I have added one with just that setting. Will see if that works - thanks!
Sorry _ i hadn’t marked the solution, as I was waiting to see if it did in deed work - and then forgot to come back But I have marked the solution now, which was to change the PHP.ini setting session.gc_probability needs to be set back to 1 instead of 0. Or connect the site to SiteDash.
This topic was automatically closed 2 days after discussion ended and a solution was marked. New replies are no longer allowed. You can open a new topic by clicking the link icon below the original post or solution and selecting “+ New Topic”.