Bug #69860 [NEW]: php-fpm process accounting is broken with keepalive
| From: | dyeldandi at gramant dot ru | Date: | Wed, 17 Jun 2015 10:58:42 +0000 |
| Subject: | Bug #69860 [NEW]: php-fpm process accounting is broken with keepalive | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-193600@lists.php.net to get a copy of this message | ||
From: dyeldandi at gramant dot ru
Operating system: Linux (CentOS 6)
PHP version: 5.5.26
Package: FPM related
Bug Type: Bug
Bug description:php-fpm process accounting is broken with keepalive
Description:
------------
When php-fpm is used with keepalive (fastcgi_keep_conn on; in nginx)
php-fpm starts killing workers (and slow-logging requests). That is
happening because proc->accepted is not updated when a new request is
started in an existing connection. And this is because
fpm_request_reading_headers() is not being called from
fcgi_accept_request() (fastcgi.c line 806) when req->fd >= 0.
So when a cumulative time of number of requests along with waiting time
between requests exceed request_slowlog_timeout (configured in
php-fpm.conf) php-fpm starts slow-logging requests and when it is higher
than request_terminate_timeout a perfectly good worker gets killed.
This can be easily observed by configuring pm.status_path = /status and
hitting http://localhost/status?full , request duration:
for running
requests becomes too large (accumulates) and never goes down unless
worker gets killed.
Proposed fix is to simply add fpm_request_reading_headers(); after
if (fcgi_read_request(req)) {
in fcgi_accept_request()
--
Edit bug report at https://bugs.php.net/bug.php?id=69860&edit=1
--
Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=69860&r=trysnapshot54
Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=69860&r=trysnapshot55
Try a snapshot (trunk): https://bugs.php.net/fix.php?id=69860&r=trysnapshottrunk
Fixed in SVN: https://bugs.php.net/fix.php?id=69860&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=69860&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=69860&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=69860&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=69860&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=69860&r=support
Expected behavior: https://bugs.php.net/fix.php?id=69860&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=69860&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=69860&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=69860&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=69860&r=php4
Daylight Savings: https://bugs.php.net/fix.php?id=69860&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=69860&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=69860&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=69860&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=69860&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=69860&r=mysqlcfg