php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55526 Heartbeat causes a lot of unnecessary events
Submitted: 2011-08-28 16:59 UTC Modified: 2011-10-09 15:12 UTC
Votes:1
Avg. Score:4.0 ± 0.0
Reproduced:0 of 0 (0.0%)
From: adrien at antipoul dot fr Assigned: fat
Status: Closed Package: FPM related
PHP Version: 5.3.8 OS: Linux
Private report: No CVE-ID:
 [2011-08-28 16:59 UTC] adrien at antipoul dot fr
Description:
------------
Hi,

It seems that FPM has a heartbeat each 130ms. This is really short, and make php-fpm the #1 event generator on my personal server, that also runs Apache, NGinx, dovecot, powerdns, NSD3 and unicorn.
There might be a good reason for such a heartbeat, but there also might be a way to at least increase it to 5 or 10 seconds.
I'll be glad to help and get rid of this, as soon as I understand what this heartbeat is helpful for.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-28 19:19 UTC] fat@php.net
-Status: Open +Status: Assigned -Assigned To: +Assigned To: fat
 [2011-08-29 08:22 UTC] fat@php.net
The FPM heartbeat is used to check timeouts on its children which includes:
- request_terminate_timeout
- request_slowlog_timeout

If you don't use those features, the heartbeat is useless as it does nothing.
If you use those features, you can higher the heartbeat frequency accordingly.

If you need to change it quickly, you can edit the source file fpm_process_ctl.h 
and change 
 /* 130ms heartbeat for pctl */
 #define FPM_PCTL_HEARTBEAT (130)
to what you want.
 [2011-08-29 08:24 UTC] fat@php.net
-Status: Assigned +Status: Analyzed
 [2011-08-29 08:24 UTC] fat@php.net
In fact the FPM heartbeat should be disabled if request_terminate_timeout and 
request_slowlog_timeout are not set on all pools. And if they are, the heartbeat 
frequency should be generated dynamically.

A patch is coming (no ETA yet)
 [2011-08-29 08:28 UTC] adrien at antipoul dot fr
Thanks for your understanding.
When the patch is ready, I'll be glad to test it. I'm really not used to PHP's internals, otherwise, I should have do it myself.
 [2011-10-09 15:10 UTC] fat@php.net
-Summary: Heartbeat rate too high causes a lot of events +Summary: Heartbeat causes a lot of unnecessary events -Type: Feature/Change Request +Type: Bug
 [2011-10-09 15:12 UTC] fat@php.net
Automatic comment from SVN on behalf of fat
Revision: http://svn.php.net/viewvc/?view=revision&revision=317937
Log: - Fixed bug #55526 (Heartbeat causes a lot of unnecessary events)
 [2011-10-09 15:12 UTC] fat@php.net
-Status: Analyzed +Status: Closed
 [2011-10-09 15:12 UTC] fat@php.net
This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.

 For Windows:

http://windows.php.net/snapshots/
 
Thank you for the report, and for helping us make PHP better.


 [2012-04-18 09:48 UTC] laruence@php.net
Automatic comment on behalf of fat
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c15987bdd454db779dd9316569859bf5d4b2ea89
Log: - Fixed bug #55526 (Heartbeat causes a lot of unnecessary events)
 [2012-07-24 23:39 UTC] rasmus@php.net
Automatic comment on behalf of fat
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c15987bdd454db779dd9316569859bf5d4b2ea89
Log: - Fixed bug #55526 (Heartbeat causes a lot of unnecessary events)
 [2013-11-17 09:36 UTC] laruence@php.net
Automatic comment on behalf of fat
Revision: http://git.php.net/?p=php-src.git;a=commit;h=c15987bdd454db779dd9316569859bf5d4b2ea89
Log: - Fixed bug #55526 (Heartbeat causes a lot of unnecessary events)
 
PHP Copyright © 2001-2014 The PHP Group
All rights reserved.
Last updated: Sun Apr 20 19:01:51 2014 UTC