Websites are not available and there is a php-fpm process that consumes 100%CPU

Created:

2017-07-10 15:34:22 UTC

Modified:

2017-08-16 17:16:22 UTC

0

Was this article helpful?


Have more questions?

Submit a request

Websites are not available and there is a php-fpm process that consumes 100%CPU

Applicable to:

  • Plesk for Linux

Symptoms

Websites are not available and there is a stuck php-fpm process that consumes 100% CPU. Only PHP-FPM 5.6 causes such behavior and restart of the PHP-FPM service fixes the issue

# top -c
Tasks: 1200 gesamt, 2 laufend, 1198 schlafend, 0 gestoppt, 0 Zombie
%CPU(s): 2.6 be, 10.0 sy, 0.0 ni, 87.3 un, 0.0 wa, 0.0 hi, 0.0 si, 0.0 st
[..]
PID USER PR NI VIRT RES SHR S %CPU %MEM ZEIT+ BEFEHL
39053 web69 20 0 427260 16288 7240 R 100.0 0.1 191:34.18 php-fpm: pool example.com

If attache to php-fpm process using strace tool, it produces the following output:

# strace -p39053
strace: Process 39053 attached
kill(39005, SIGKILL) = -1 EPERM (Operation not permitted)
fcntl(4, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=39005}) = 0
kill(39005, SIGKILL) = -1 EPERM (Operation not permitted)
fcntl(4, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=39005}) = 0
kill(39005, SIGKILL) = -1 EPERM (Operation not permitted)
fcntl(4, F_GETLK, {l_type=F_RDLCK, l_whence=SEEK_SET, l_start=1, l_len=1, l_pid=39005}) = 0
kill(39005, SIGKILL) = -1 EPERM (Operation not permitted)

Cause

This is a PHP-FPM 5.6 bug #74709

Resolution

There are several workarounds for the issue:

  1. Disable OPCache module for the PHP-FPM 5.6 in Home > Tools&Settings > PHP Settings > 5.6.30 FPM application , uncheck opcache and press OK
  2. If OPCache is necessary, switch the domains to another PHP handler. It can be done for multiple domains via Service Plans.
  3. Forbid calling function kill all lockers in php.ini tab for PHP-FPM 5.6 in Home > Tools&Settings > PHP Settings > 5.6.30 FPM application
Have more questions? Submit a request
Please sign in to leave a comment.