Symptoms
All inodes are used in /tmp when PHP-FPM is used.
Description
When a /tmp partition is smaller in size the inode count has the potential of being reached when PHP-FPM is used. On a CentOS server systemd enables PrivateTmp with "PrivateTmp=true" and forces the files to be written into /tmp
Workaround
The workaround here is to put a root cron job in place to remove sess_* files older than 1 day. This cron job should be run at the end of the day at 11 PM instead of 1 AM as that will just leave one hour of sess_ files in place. The command to add to root's crontab is:
find /tmp/systemd-private*php-fpm.service* -name sess_* ! -mtime -1 -exec rm -f '{}' \;
This command will remove sess_* files older than one day. This can be changed with the mtime variable. The above has -1 one but you can change this to -3 for 3 days instead.
Comments
0 comments
Article is closed for comments.