understand pm.max_children tuning
up vote
0
down vote
favorite
I have done some investigations and I have found this to calculate and adjust pm.max_children value
https://myshell.co.uk/blog/2012/07/adjusting-child-processes-for-php-fpm-nginx/
but for example :
- I have 8Gb on my server
- I'm hosting 30 websites
- php-fpm average process size around 40mb
- php-fpm max process size around 80mb
- I want to allocate 5Gb max of my memory to php-fpm processes
If I apply this :
pm.max_children = Total RAM dedicated to the web server / Max child process size
So in my case :
pm.max_children = 5120 / 80 = 64
But If I add pm.max_children = 64 on each php-fpm website conf files, this means every website can use 64 children process X size of 1 process (ex 40mb) = 2560Mb
And If we imagine, at the same time, all the 30 website have reach the pm.max_children value, we will have : 2560Mb (max per website) x 30 websites = 76 800 Mb
Am I correct?
Si yes, this means when many websites are hosted on the same server, we have to divide the result of the calcul pm.max_children = 5120 / 80 = 64 by the number of websites hosted (here 30).
So 64 / 30 = 2,1 and pm.max_children = 2 per website
Is it correct or not?
Thanks
php web memory php-7.2 fpm
|
show 4 more comments
up vote
0
down vote
favorite
I have done some investigations and I have found this to calculate and adjust pm.max_children value
https://myshell.co.uk/blog/2012/07/adjusting-child-processes-for-php-fpm-nginx/
but for example :
- I have 8Gb on my server
- I'm hosting 30 websites
- php-fpm average process size around 40mb
- php-fpm max process size around 80mb
- I want to allocate 5Gb max of my memory to php-fpm processes
If I apply this :
pm.max_children = Total RAM dedicated to the web server / Max child process size
So in my case :
pm.max_children = 5120 / 80 = 64
But If I add pm.max_children = 64 on each php-fpm website conf files, this means every website can use 64 children process X size of 1 process (ex 40mb) = 2560Mb
And If we imagine, at the same time, all the 30 website have reach the pm.max_children value, we will have : 2560Mb (max per website) x 30 websites = 76 800 Mb
Am I correct?
Si yes, this means when many websites are hosted on the same server, we have to divide the result of the calcul pm.max_children = 5120 / 80 = 64 by the number of websites hosted (here 30).
So 64 / 30 = 2,1 and pm.max_children = 2 per website
Is it correct or not?
Thanks
php web memory php-7.2 fpm
Optimize for the average case, and not maxima or peaks until they arise.
– mario
Nov 9 at 14:38
Ok but even If i optimise for the average case am I wrong or not with the calculation method? I mean regarding my last post, pm.max_children should be 64 or 2 ?
– TooNetCreation
Nov 9 at 14:57
so good calculation is pm.max_children = 5120 / 80 = 64 so pm.max_children =64 for each website or pm.max_children = 5120 / 80 = 64 and 64 / 30 (number of websites) = 2 so pm.max_children =2 for each website ?
– TooNetCreation
Nov 9 at 14:58
I have opened a specific ticket with all infos and replies : serverfault.com/questions/939436/…
– TooNetCreation
Nov 10 at 9:16
nobody has infos or can confirm?
– TooNetCreation
Nov 11 at 9:42
|
show 4 more comments
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have done some investigations and I have found this to calculate and adjust pm.max_children value
https://myshell.co.uk/blog/2012/07/adjusting-child-processes-for-php-fpm-nginx/
but for example :
- I have 8Gb on my server
- I'm hosting 30 websites
- php-fpm average process size around 40mb
- php-fpm max process size around 80mb
- I want to allocate 5Gb max of my memory to php-fpm processes
If I apply this :
pm.max_children = Total RAM dedicated to the web server / Max child process size
So in my case :
pm.max_children = 5120 / 80 = 64
But If I add pm.max_children = 64 on each php-fpm website conf files, this means every website can use 64 children process X size of 1 process (ex 40mb) = 2560Mb
And If we imagine, at the same time, all the 30 website have reach the pm.max_children value, we will have : 2560Mb (max per website) x 30 websites = 76 800 Mb
Am I correct?
Si yes, this means when many websites are hosted on the same server, we have to divide the result of the calcul pm.max_children = 5120 / 80 = 64 by the number of websites hosted (here 30).
So 64 / 30 = 2,1 and pm.max_children = 2 per website
Is it correct or not?
Thanks
php web memory php-7.2 fpm
I have done some investigations and I have found this to calculate and adjust pm.max_children value
https://myshell.co.uk/blog/2012/07/adjusting-child-processes-for-php-fpm-nginx/
but for example :
- I have 8Gb on my server
- I'm hosting 30 websites
- php-fpm average process size around 40mb
- php-fpm max process size around 80mb
- I want to allocate 5Gb max of my memory to php-fpm processes
If I apply this :
pm.max_children = Total RAM dedicated to the web server / Max child process size
So in my case :
pm.max_children = 5120 / 80 = 64
But If I add pm.max_children = 64 on each php-fpm website conf files, this means every website can use 64 children process X size of 1 process (ex 40mb) = 2560Mb
And If we imagine, at the same time, all the 30 website have reach the pm.max_children value, we will have : 2560Mb (max per website) x 30 websites = 76 800 Mb
Am I correct?
Si yes, this means when many websites are hosted on the same server, we have to divide the result of the calcul pm.max_children = 5120 / 80 = 64 by the number of websites hosted (here 30).
So 64 / 30 = 2,1 and pm.max_children = 2 per website
Is it correct or not?
Thanks
php web memory php-7.2 fpm
php web memory php-7.2 fpm
edited Nov 9 at 20:16
asked Nov 9 at 14:13
TooNetCreation
125
125
Optimize for the average case, and not maxima or peaks until they arise.
– mario
Nov 9 at 14:38
Ok but even If i optimise for the average case am I wrong or not with the calculation method? I mean regarding my last post, pm.max_children should be 64 or 2 ?
– TooNetCreation
Nov 9 at 14:57
so good calculation is pm.max_children = 5120 / 80 = 64 so pm.max_children =64 for each website or pm.max_children = 5120 / 80 = 64 and 64 / 30 (number of websites) = 2 so pm.max_children =2 for each website ?
– TooNetCreation
Nov 9 at 14:58
I have opened a specific ticket with all infos and replies : serverfault.com/questions/939436/…
– TooNetCreation
Nov 10 at 9:16
nobody has infos or can confirm?
– TooNetCreation
Nov 11 at 9:42
|
show 4 more comments
Optimize for the average case, and not maxima or peaks until they arise.
– mario
Nov 9 at 14:38
Ok but even If i optimise for the average case am I wrong or not with the calculation method? I mean regarding my last post, pm.max_children should be 64 or 2 ?
– TooNetCreation
Nov 9 at 14:57
so good calculation is pm.max_children = 5120 / 80 = 64 so pm.max_children =64 for each website or pm.max_children = 5120 / 80 = 64 and 64 / 30 (number of websites) = 2 so pm.max_children =2 for each website ?
– TooNetCreation
Nov 9 at 14:58
I have opened a specific ticket with all infos and replies : serverfault.com/questions/939436/…
– TooNetCreation
Nov 10 at 9:16
nobody has infos or can confirm?
– TooNetCreation
Nov 11 at 9:42
Optimize for the average case, and not maxima or peaks until they arise.
– mario
Nov 9 at 14:38
Optimize for the average case, and not maxima or peaks until they arise.
– mario
Nov 9 at 14:38
Ok but even If i optimise for the average case am I wrong or not with the calculation method? I mean regarding my last post, pm.max_children should be 64 or 2 ?
– TooNetCreation
Nov 9 at 14:57
Ok but even If i optimise for the average case am I wrong or not with the calculation method? I mean regarding my last post, pm.max_children should be 64 or 2 ?
– TooNetCreation
Nov 9 at 14:57
so good calculation is pm.max_children = 5120 / 80 = 64 so pm.max_children =64 for each website or pm.max_children = 5120 / 80 = 64 and 64 / 30 (number of websites) = 2 so pm.max_children =2 for each website ?
– TooNetCreation
Nov 9 at 14:58
so good calculation is pm.max_children = 5120 / 80 = 64 so pm.max_children =64 for each website or pm.max_children = 5120 / 80 = 64 and 64 / 30 (number of websites) = 2 so pm.max_children =2 for each website ?
– TooNetCreation
Nov 9 at 14:58
I have opened a specific ticket with all infos and replies : serverfault.com/questions/939436/…
– TooNetCreation
Nov 10 at 9:16
I have opened a specific ticket with all infos and replies : serverfault.com/questions/939436/…
– TooNetCreation
Nov 10 at 9:16
nobody has infos or can confirm?
– TooNetCreation
Nov 11 at 9:42
nobody has infos or can confirm?
– TooNetCreation
Nov 11 at 9:42
|
show 4 more comments
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53227355%2funderstand-pm-max-children-tuning%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53227355%2funderstand-pm-max-children-tuning%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Optimize for the average case, and not maxima or peaks until they arise.
– mario
Nov 9 at 14:38
Ok but even If i optimise for the average case am I wrong or not with the calculation method? I mean regarding my last post, pm.max_children should be 64 or 2 ?
– TooNetCreation
Nov 9 at 14:57
so good calculation is pm.max_children = 5120 / 80 = 64 so pm.max_children =64 for each website or pm.max_children = 5120 / 80 = 64 and 64 / 30 (number of websites) = 2 so pm.max_children =2 for each website ?
– TooNetCreation
Nov 9 at 14:58
I have opened a specific ticket with all infos and replies : serverfault.com/questions/939436/…
– TooNetCreation
Nov 10 at 9:16
nobody has infos or can confirm?
– TooNetCreation
Nov 11 at 9:42