Article ID: 119500, created on Jan 7, 2014, last review on Apr 23, 2016

  • Applies to:
  • Plesk 12.5 for Linux
  • Plesk 12.0 for Linux
  • Plesk 11.0 for Linux
  • Plesk 11.5 for Linux
  • Plesk 10.4 for Linux/Unix


The article is applies to RPM based OS.

  1. The folder containing PHP sessions has a large number of files:

    ~# ls -l /var/lib/php/session | wc -l
  2. When running /etc/cron.hourly/plesk-php-cleanuper, CPU consumption increases to 100%.

  3. When attempting to find all working PHP session processes, this fails with the following error:

    ~# [ -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) ! -execdir fuser {} \; -delete
        Cannot open a network socket.
        Cannot open /proc directory: Too many open files
        fuser: error while loading shared libraries: cannot open shared object file: Error 24
        find: Failed to save working directory in order to run a command on `sess_fch2h2dm7s73t0g09r3dmepdp0': Too many open files


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.


  1. Check the size of directory /var/lib/php/session file:

    # du -h /var/lib/php/session
    328M    /var/lib/php/session

If directory file size is larger than 1 MB, it is needed to recreate it:

    # rm -rf /var/lib/php/session
    # mkdir /var/lib/php/session
    # chmod 1733 /var/lib/php/session/

If directory file size is equal or less than 1 MB, then:

  1. 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
  2. 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:

    ~# cat /etc/cron.hourly/plesk-php-cleanuper
    ulimit -n 30480
  3. Re-run the required Cron Job and check that it completes successfully .

Search Words

php sessions high cpu

Too many open files


php tmp garbage session



plesk does not work

PHP garbage collector no longer works if session folder has 755 permissions.

php session

ior/iow time



plesk-php-cleanuper not working

php session files not cleaned up


Linux inode usage too high

a914db3fdc7a53ddcfd1b2db8f5a1b9c 56797cefb1efc9130f7c48a7d1db0f0c 01bc4c8cf5b7f01f815a7ada004154a2 29d1e90fd304f01e6420fbe60f66f838 0a53c5a9ca65a74d37ef5c5eaeb55d7f e0aff7830fa22f92062ee4db78133079 e8756e9388aeca36710ac39e739b2b37 dd0611b6086474193d9bf78e2b293040 caea8340e2d186a540518d08602aa065 aea4cd7bfd353ad7a1341a257ad4724a 2a5151f57629129e26ff206d171fbb5f e335d9adf7edffca6a8af8039031a4c7 742559b1631652fadd74764ae8be475e

Email subscription for changes to this article
Save as PDF