Apache CPU usage and Memory usage is too high [warn-phpd] mmap cache can't open /var/www/vhosts/example.com/httpdocs too many open files

Created:

2016-11-16 12:50:43 UTC

Modified:

2017-04-24 11:13:38 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Apache CPU usage and Memory usage is too high [warn-phpd] mmap cache can't open /var/www/vhosts/example.com/httpdocs too many open files

Applicable to:

  • Plesk Onyx for Linux
  • Plesk 11.0 for Linux
  • Plesk 12.0 for Linux

Symptoms

Server is operating in normal mode, but Apache CPU usage and Memory usage is too high.In /var/log/httpd/error_log file you can find the following error:

[warn-phpd] mmap cache can't open /var/www/vhosts/example.com/httpdocs too many open files (pid 885428)

Cause

This behavior appears when in Apache configuration PHP_ADMIN_VALUE , open_basedir or safe_mode is set as 'ON'. It reduces performance of PHP Engine and this behavior can strongly affect server performance.

Please refer to: http://bugs.php.net/bug.php?id=52312

Resolution

  1. Set php.ini settings with parameter values like as the following:

    realpath_cache_size=1024k   
    realpath_cache_ttl=7200
    realpath_cache_size=40960k
    realpath_cache_ttl=72000
    memory_limit = 96M
  2. Add the following line into the /etc/init.d/httpd startup script:

    start() {
    #Raise the ulimit
    ulimit -n 262144 <--- add this line
Have more questions? Submit a request
Please sign in to leave a comment.