-
-
Notifications
You must be signed in to change notification settings - Fork 529
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add session garbage collector check #16287
Conversation
Does this prevent running the install or is this just a warning at the end after install completed? |
@Mark-H In this case, the installation will not continue - |
There is also the question of whether it is necessary to check ONLY by |
Lowering to warning would be much better in my opinion. While yes it can cause issues to not have GC running, it shouldn't have to stop someone from running MODX entirely. There are non-server-configuration fixes for it. SiteDash has a remote session GC feature that's on by default for example. Or people could run a simple plugin like this to replicate a typical 1-in-1000 trigger:
|
Yes, I will indicate through a warning, this will be enough. |
That depends entirely on your server and traffic. You don't want it running too often, as it has a performance penalty, but you also don't want it to run too rarely as then it doesn't seem to work and will take a very long time to run when it finally does run. Last I checked, MODX Cloud has it set to 1 in 1000, but as some of my dev sites are very low-traffic, that still has sessions from months ago. But if you run a production site that gets tens of thousands of hits per day, that might cause it to run too often. I think having it run once to twice a day is a good target in general. That means a probability of 1 and a divisor equal to your daily (php-served) requests. In SiteDash's default setting, it runs the gc when there are sessions in the database older than 4 weeks. With a 1-week default session lifetime, that means it ends up running roughly every 3 weeks for sites that don't have GC or have a much too high divisor for the traffic it gets. When changing SiteDash to it's "enabled" option (meant for when you know GC doesn't run on the server), it has a self-optimizing interval. I think it starts at 2 days. Then every time it runs, it either makes the interval longer (if it cleared less than 150 sessions) or shorter (if it cleared more than 500 sessions). And then applies a hard limit of at least 12 hours and at most 30 days. |
Maybe we should just print |
Yeah I'm okay with the warning. Maybe it's better to focus this on education, I'll make a note to write a new page in the docs about this issue and possible ways to go about it. |
### What does it do? It often happens that the `modx_session` table grows uncontrollably (I have seen up to 5 gigabytes), which sometimes leads to complete non-operation of both the site and the server. I added session garbage collector check in installer. ![gc_installer_warn](https://user-images.githubusercontent.com/12523676/196445992-6b161c2c-519e-4cc4-bbe4-5ee67e60d150.png) ### Why is it needed? That there were no problems with overflow of the table `modx_session`. ### How to test Make the installation from scratch by changing the `session.gc_probability, session.gc_divisor` parameters. ### Related issue(s)/PR(s) #16287 #16275
### What does it do? It often happens that the `modx_session` table grows uncontrollably (I have seen up to 5 gigabytes), which sometimes leads to complete non-operation of both the site and the server. I added session garbage collector check in installer. ![gc_installer_warn](https://user-images.githubusercontent.com/12523676/196445992-6b161c2c-519e-4cc4-bbe4-5ee67e60d150.png) ### Why is it needed? That there were no problems with overflow of the table `modx_session`. ### How to test Make the installation from scratch by changing the `session.gc_probability, session.gc_divisor` parameters. ### Related issue(s)/PR(s) #16287 #16275
What does it do?
It often happens that the
modx_session
table grows uncontrollably (I have seen up to 5 gigabytes), which sometimes leads to complete non-operation of both the site and the server.I added session garbage collector check in installer.
Why is it needed?
That there were no problems with overflow of the table
modx_session
.How to test
Make the installation from scratch by changing the
session.gc_probability, session.gc_divisor
parameters.Related issue(s)/PR(s)
#16275