-
Notifications
You must be signed in to change notification settings - Fork 8k
Max spawn child processes rate at once #6753
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
Could you elaborate why/when you need to adjust this setting? |
eac4b63 to
8ac8e6e
Compare
16abcc9 to
ff2659b
Compare
|
cc @bukka |
|
It looks good and think it makes sense to have an option for this. The code looks good as well. Just one thing - could you please add some basic test? I realise that a properly test this might be a bit flaky or a bit too have for CI env so maybe something just basic to at least check that it's possible to set it. |
370e7b8 to
8f009b9
Compare
9b450ee to
5724f4e
Compare
@bukka I'm added a simple set test and merge commits. |
bukka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Just few minor things re the test.
0f593e9 to
994ecb0
Compare
bukka
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good! Just few minor comments.
|
@PauliusSap Please could you then also squash it to a single commit. |
|
And one more thing. Could you possibly also run fpm with this setting - possibly do one ping so it's kind of verified in the test that it's running. Something like extending config with and then add to the test something like |
025539b to
0999f33
Compare
I use test argument.
Second |
ba776f2 to
dded5e2
Compare
* Add functionality to expect log config options
dded5e2 to
b9963f0
Compare
Done |
|
Merged via eac1609 |
> - FPM: > . Added new pool option for the dynamic process manager called > `pm.max_spawn_rate`. It allows to start number of children in a faster rate > when dynamic pm is selected. The default value is 32 which was the previous > hard coded value. Includes unit tests. Refs: * https://github.com/php/php-src/blob/f67986a9218f4889d9352a87c29337a5b6eaa4bd/UPGRADING#L240-L243 * https://github.com/php/php-src/blob/33cd61c9045ae8675448456cdda6fb244b2efa01/NEWS#L280-L281 * php/php-src#6753 * php/php-src@eac1609
Problem is when you need spawn very fast a lot of fpm child processes in the dynamic mode (pm = dynamic).
After every spawn it's make 1000ms pause (i think it's HEARTBEAT checker).
Child processes spawn algorithm growth x2 while exceed maximum spawn rate at this moment hardcoded value 32.
When you need spawn a lot of child processes you take a lot of time.
Example we have already spawned 3000 child processes at high load traffic need spawn fast +900 child processes.
Result is: we wait 30 seconds to spawn +920 child processes.
Summary: it's good to have this setting in the configuration because spawn new child processes don't have some heavy overhead.