/var/lib/php/session cleanup failing

We found one of our servers had exceeded the inode limit of 400,000. Upon investigation, there were about 250,000 files in /var/lib/php/session

Cause
The script plesk-php-cleanuper contains a string ! -execdir fuser {} \, which opens every file in the /var/lib/php/session directory and checks that it is not used by a working process and can be deleted. However, the maximum number of open files is set to 1024 by default.

Resolution
Clear /var/lib/php/session using this script without the checker:
~# [ -x /usr/lib64/plesk-9.0/maxlifetime ] && [ -d /var/lib/php/session ] && find /var/lib/php/session -depth -mindepth 1 -maxdepth 1 -type f -cmin +$(/usr/lib64/plesk-9.0/maxlifetime) -delete
Increase the limit for open files to the required value.
To get the maximum number of open files, run:
~# ulimit -a
open files (-n) 1024
Add ulimit -n 30480 to /etc/cron.hourly/plesk-php-cleanuper:
~#vi /etc/cron.hourly/plesk-php-cleanuper
~#!/bin/sh
~ulimit -n 30480

Re-run the required Cron Job and check that it completes successfully .

http://kb.odin.com/en/119500