4

Anyone had a similar problem with php-fpm 7 with 11.0-RELEASE-p8 or know how to debug it?

Situation starts after few minutes and show only half pages to clients. Any pages show up about ~62kb of content with ending ��������� 4.

Log file of php-fpm:

[18-Mar-2017 15:41:49] NOTICE: [pool www] child 80582 exited with code 0 after 0.005648 seconds from start
[18-Mar-2017 15:41:49] NOTICE: [pool www] child 80584 started
[18-Mar-2017 15:41:49] NOTICE: [pool www] child 80583 exited with code 0 after 0.005877 seconds from start
[18-Mar-2017 15:41:49] NOTICE: [pool www] child 80585 started
[18-Mar-2017 15:41:49] NOTICE: [pool www] child 80581 exited with code 0 after 0.007763 seconds from start
[18-Mar-2017 15:41:49] NOTICE: [pool www] child 80586 started
[18-Mar-2017 15:41:49] NOTICE: [pool www] child 80585 exited with code 0 after 0.005653 seconds from start
[18-Mar-2017 15:41:49] NOTICE: [pool www] child 80587 started
[18-Mar-2017 15:41:49] NOTICE: [pool www] child 80586 exited with code 0 after 0.005820 seconds from start
[18-Mar-2017 15:41:49] NOTICE: [pool www] child 80588 started

PHP config:

$php -v
PHP 7.0.17 (cli) (built: Mar 17 2017 02:07:44) ( NTS )
Copyright (c) 1997-2017 The PHP Group
Zend Engine v3.0.0, Copyright (c) 1998-2017 Zend Technologies
    with Zend OPcache v7.0.17, Copyright (c) 1999-2017, by Zend Technologies

PHP-FPM.conf

pm = dynamic
pm.max_children = 25
pm.start_servers = 2
pm.min_spare_servers = 2
pm.max_spare_servers = 3
pm.max_requests = 0 ;changing to 500
3
  • php-fpm messages are not relevant to the problem that you describe, check nginx error log. – Federico Sierra Mar 18 '17 at 17:18
  • nginx is not giving any errors so far... looks normal usage. – busy Mar 21 '17 at 14:52
  • restarting php-fpm helps, looks like some buffer randomly get leaked. – busy Mar 24 '17 at 8:17
6

it is php-fpm bug when using exec functions inside a code. good practice is to block them so the won't make such problem.

https://bugs.php.net/bug.php?id=73342

bug is open for last 4 years.

2
  • Is this likely to be the only cause of the error OP has mentioned? If so, would changing up to PHP7.1 be a probable solution? I also have a server where that error is occurring constantly. Multiple time per second. I found this post on serverfault whilst looking for info on its cause. – inspirednz Mar 9 '18 at 7:41
  • @inspirednz this bug also affects PHP 7.1. It occurs when running a script which uses stdin, be it PHP or the sub-process launched in shell_exec or exec. – Yvan May 27 '18 at 5:02
6

First, this is the expected behavior. The messages are marked as NOTICE, the default in php-fpm.conf:

; Log level
; Possible Values: alert, error, warning, notice, debug
; Default Value: notice
;log_level = notice

Processes are exiting and respawning when pm.max_requests option is defined in your php-fpm configuration file.

For example:

; The number of requests each child process should execute before respawning.
; This can be useful to work around memory leaks in 3rd party libraries. For
; endless request processing specify '0'. Equivalent to PHP_FCGI_MAX_REQUESTS.
; Default Value: 0
pm.max_requests = 500

If it is defined as 500 in this example, php-fpm recycles the process after it has processed 500 requests. Actually, you can ignore these messages because they are harmless and just informational.

If you don't want those messages to be logged, just change your log level to something above notice, like warning.

1
  • 1
    Thanks for the reply about logs. The problem here is that all pages output is blank until you restart the server, it does not matter if php-fpm respawn. The same behaviour on PHP 7.1 and 7.2 - I do not even think to enable exec function on php7.3 - but did not test it. – busy Mar 12 '19 at 22:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.