|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #68824 php-rpm pm=static causes load peaks when pm.max_requests is reached
Submitted: 2015-01-13 11:29 UTC Modified: 2021-12-04 21:12 UTC
Avg. Score:3.5 ± 0.5
Reproduced:1 of 2 (50.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: rainer-phpbugs at 7val dot com Assigned: bukka (profile)
Status: Assigned Package: FPM related
PHP Version: 5.6.4 OS: linux
Private report: No CVE-ID: None
Have you experienced this issue?
Rate the importance of this bug to you:

 [2015-01-13 11:29 UTC] rainer-phpbugs at 7val dot com
By design, php-fpm starts all pm.max_children at the same time, and therefore, will also re-start all children roughly at the same time when they reach  pm.max_requests. This causes the load on the Server, as well as latencies to increase until all children are re-started, their caches warmed up etc.

It would be preferable to randomize the number of requests until a child is reaped, instead of always using exactly pm.max_requests. For example, a random value within  pm.max_requests plus or minus 10% could be chosen for each child.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2015-01-13 17:58 UTC]
-Package: Performance problem +Package: FPM related
 [2021-12-04 21:12 UTC]
-Type: Bug +Type: Feature/Change Request -Assigned To: +Assigned To: bukka
 [2021-12-04 21:12 UTC]
This is the way how the accept scheduling works - this could be improved by using epoll which we might need for other things (e.g. bootstrapping) as well. See related discussion for more details in this pr (it is for ondemand but the actual loop is not mode dependent):

I'm changing this to request as it is more feature request though.
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Mon Dec 11 16:01:28 2023 UTC