Hello,
Today I found one of my CP servers to be partially down because it hit the inodes limit - PHP session files filled up php/sessions/ and /tmp/ folders and after deleting some files, I found out that they were never being deleted and were piling up from day 1.
After my investigation, I found that:
-
CyberPanel enforces session.gc_probability as 0 in PHP configs which stops trash collector from working.
-
CyberPanel has a cronjob to delete older session files, but multiple forum posts dated around 2022 stated that the bash command is wrong and has to be manually changed for it to work. After looking into it, the bash doesn’t exist at all in my instance, it is listed in crontab, but the file doesn’t even exist:
root@srv1:~# crontab -l | grep cleansessions
09,39 * * * * /usr/local/CyberCP/bin/cleansessions >/dev/null 2>&1
root@srv1:~# ls -lah /usr/local/CyberCP/bin/cleansessions
ls: cannot access ‘/usr/local/CyberCP/bin/cleansessions’: No such file or directory
I have 3 different VPS servers and this file doesn’t exist in any of them.
Version: 2.3.8
I wasn’t able to find any related posts from the recent years, so I’d like the CP developers to confirm what is the situation and the best approach here?:
-
Why is CyberPanel not handling this through neither of these approaches? It’s a ticking time bomb for the inodes to be hit for almost all websites;
-
Will session.gc_probability even work when enabled, or is it hardcoded in CyberPanel to disable it either way?
2.1. If not disabled globally, what is the better approach to fix this issue (besides moving sessions saving to redis/memcached) - to just enable session.gc_probability or to create the bash of cleansessions and fix it?