-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Description
Line 134 in 76102d2
@ini_set('session.gc_probability', 1); |
As in the code snippet above setting
session.gc_probability=1
in general causes problems for different environments. For example our session handler is redis and session save_path for webserver is /var/run/redis.sock
In this case automatic garbage cleanup will attempt to cleanup a directory to which it does not have access to, For example, opendir(/var/lib/php/session) failed: permission denied fails in my case.
As a result I see errors like
ERROR Piwik\Session[2019-12-12 09:14:06 UTC] [2267b] Unable to start session
Occasionally which are frequent but hard to reproduce.
Many systems do not give permission to session directory because they have some kind of cron to periodically clear expired session files. Just the php recommendation
When you are using redis for php sessions there is no need for garbage collection since TTL will take care of removing old sessions. Hence session.gc_probability should be zero.
Now, this concerned me because link to configure redis for matomo sessions
Should we
- update code base with something like
@ini_set(Config->getInstance()->General['session_gc_probability']);
2.) Just update the FAQ link with help..(I don't know what help. How do we tell matomo not to force gc_probability to 1? Is there an event? Can I do Dependency injection?)
3.) leave it alone for now