Can’t Create or Write on /tmp With Error: No space left on device

I just got a problem with writing error on /tmp on one of my client server. The strange problem is that df -h command shows that /tmp only 35% used so there should be plenty of space to write on.

After some investigation it seems that the /tmp partition hit the number of files limit due to caching files from nginx filling up /tmp, hence it’s not possible to create new files. This problem cause PHP scripts on Cpanel server to show error regarding session as by default Cpanel installation, PHP session are written in /tmp.

Clearing nginx cache files seems to fix the problem. To prevent this from happening again I setup a cron job to clear nginx cache regularly.

Leave a Reply

Your email address will not be published. Required fields are marked *