Articles in this section

Slow performance of website hosted on Plesk for Linux server: Load Average value is higher than CPU cores count

Plesk for Linux kb: technical ext: migrator ABT: Group A

Applicable to:

  • Plesk for Linux

Symptoms

  • A website hosted on a Plesk for Linux server performs slowly: loading takes more time than usual. Or websites fail with HTTP error 504.
  • Some websites have database connection errors.

  • Load Average of the server greatly exceeds CPU cores count:

    # uptime
    00:08:20 up 50 days, 21:34, 3 users, load average: 21,67, 21,59, 17,62

    # grep -c ^processor /proc/cpuinfo
    1

  • Most of the CPU power is consumed by PHP:

    # ps -o pcpu,cmd -e --sort pcpu | tail -n5
    11.0 /opt/plesk/php/5.3/bin/php-cgi -c /var/www/vhosts/system/example.com/etc/php.ini
    16.3 /opt/plesk/php/5.3/bin/php-cgi -c /var/www/vhosts/system/example2.com/etc/php.ini
    17.2 /opt/plesk/php/5.3/bin/php-cgi -c /var/www/vhosts/system/example3.com/etc/php.ini
    26.1 /opt/plesk/php/5.3/bin/php-cgi -c /var/www/vhosts/system/example4.com/etc/php.ini
    29.4 /opt/plesk/php/5.3/bin/php-cgi -c /var/www/vhosts/system/example5.com/etc/php.ini

  • Following errors can be found in error log of the Apache for subscription, /var/www/vhosts/system/example.com/logs/error_log :

    CONFIG_TEXT: mod_fcgid: read data timeout in 45 seconds
    End of script output before headers: index.php

    CONFIG_TEXT: mod_fcgid: ap_pass_brigade failed in handle_request_ipc function

  • Similar errors can be found in the log file /var/log/plesk-roundcube/errors:

    CONFIG_TEXT: DB Error: SQLSTATE[08004] [1040] Too many connections in /usr/share/psa-roundcube/program/lib/Roundcube/rcube_db.php on line 173 (POST /?_task=mail&_action=refresh)
    DB Error: [1205] Lock wait timeout exceeded; try restarting transaction <...>

Cause

There are not enough resources on server, thus new visitors have to wait until CPU can generate a page for them.
This is reflected by high Load Average values, which should rarely exceed CPU cores count.

Resolution

The following options are available:

Was this article helpful?

Comments

0 comments

Please sign in to leave a comment.