My PHP sessions on my Debian webserver using Apache2 with
mod_php seem to be failing randomly, saying that there’s no space to write them:
sudo tail -60 /var/log/apache2/error.log [Fri Jan 30 15:55:35 2015] [error] [client xxx.xxx.xxx.xxx] PHP Warning: session_start() [<a href='function.session-start'>function.session-start</a>]: open(/tmp/sess_555555555555555555, O_RDWR) failed: No space left on device (28) in /path/to-first-session-use/core/bootstrap.php on line 18
When I try to:
It just hangs forever, so that’s bad.
But when I check free space, and check that inode usage is reasonable...
$ df -h Filesystem Size Used Avail Use% Mounted on /dev/sda1 150G 121G 22G 85% / tmpfs 2.0G 0 2.0G 0% /lib/init/rw udev 10M 16K 10M 1% /dev tmpfs 2.0G 4.0K 2.0G 1% /dev/shm $ df -i Filesystem Inodes IUsed IFree IUse% Mounted on /dev/sda1 19922944 11143605 8779339 56% / tmpfs 513524 4 513520 1% /lib/init/rw udev 513524 135 513389 1% /dev tmpfs 513524 3 513521 1% /dev/shm
The numbers seem fine. Sure, 85% is more than I’d like, but it's not 99% or anything.
I was suspecting that it was a problem due to not rebooting the machine for 5 years and maybe the creation of a lot of small files but the inode info that I’m getting kinda contradicts this. Where should I investigate instead?
ls -l /
drwxrwxrwt 4 root root 692M Feb 1 11:09 tmp/ drwxr-xr-x 10 root root 4.0K Jan 1 2013 usr/ drwxr-xr-x 14 root root 4.0K Oct 7 2010 var/ ...etc