That cron job doesn’t fail because it doesn’t executes the session cleanup. As you are using systemd, the one doing the session clean-up is a systemd timer: phpsessionclean.timer that executes the service phpsessionclean.service
systemctl list-timers phpsessionclean
systemctl status phpsessionclean
Also, the php sessions should be by default in dir /var/lib/php/sessions/ not in /tmp/
Show the output of this command:
for i in $(v-list-sys-php plain);do echo "Checking PHP $i";"php${i}" -r 'echo ini_get("session.save_path") . "\n" . ini_get("session.gc_maxlifetime") . "\n";';echo;done
I thought you were talking about /tmp/ instead of /home/USER/tmp/. The default session path is /var/lib/php/sessions/, but Hestia creates custom variables and PHP settings to use /home/USER/tmp/ as upload dir, temporal dir, and session’s path when it creates the pool.
❯ cat /etc/php/8.3/fpm/pool.d/example.net.conf
; origin-src: deb/php-fpm/multiphp.tpl
;#=========================================================================#
;# Default Web Domain Template #
;# DO NOT MODIFY THIS FILE! CHANGES WILL BE LOST WHEN REBUILDING DOMAINS #
;# https://hestiacp.com/docs/server-administration/web-templates.html #
;#=========================================================================#
[exampple.net]
listen = /run/php/php8.3-fpm-exampple.net.sock
listen.owner = USER
listen.group = www-data
listen.mode = 0660
user = USER
group = USER
pm = ondemand
pm.max_children = 8
pm.max_requests = 4000
pm.process_idle_timeout = 10s
pm.status_path = /status
php_admin_value[upload_tmp_dir] = /home/USER/tmp
php_admin_value[session.save_path] = /home/USER/tmp
php_admin_value[open_basedir] = /home/USER/.composer:/home/USER/web/exampple.net/public_html:/home/USER/web/exampple.net/private:/home/USER/web/exampple.net/public_shtml:/home/USER/tmp:/tmp:/var/www/html:/bin:/usr/bin:/usr/local/bin:/usr/share:/opt
php_admin_value[sendmail_path] = /usr/sbin/sendmail -t -i -f [email protected]
env[PATH] = /usr/local/bin:/usr/bin:/bin
env[TMP] = /home/USER/tmp
env[TMPDIR] = /home/USER/tmp
env[TEMP] = /home/USER/tmp
Hestia also adds a PHP session cleanup cron job that runs daily and removes sessions older than 7 days.
So, if you have that many GBs in your tmp directory, I suppose it’s because it’s also being used as an upload directory. To have 9 GB of session files, you would need more than 2 million of them.