PHP-FPM pm.max_children and control panel and server templates

Hello, I don't know if already discussed but I don't think so.

1) pm.max_children

you set it to 9999

probably you confused this option with pm.max_requests

they are different.

If you set pm.max_children to 9999, on high load the server is unusable for sure or crash. A small botnet or some concurrents users crash the server.

So, I think you misunderstood with pm.max_requests

2) FPM control panel

it would be useful to control fpm from a control panel where you can set some variables like pm.variable, php_admin_value[var] indeed...

per domain with a dropdown and save options or something like that...

3) Server template for FPM

How do you set it at the moment? Seems not existing....

thank you

Status: 
Fixed (pending)

Comments

1 - Known issue, will be fixed in the upcoming 5.99 Virtualmin release.

2 - There is no way (yet) to edit per-domain FPM settings, but we're working on it.

3 - Do you mean a template for the per-domain FPM config file?

3) server template for 2) FPM settings (pm.variable, php_admin_value[var]...)

eg. I want that

Template ONE has

pm.max_children = 4
pm......
php_admin_value[memory_limit] = 64M
...
...

Template TWO different than ONE and so on...

thank you

and also...

why on /etc/php-fpm.d

pools are named as 141341030325393.conf instead of eg. domain_name_pool.conf or something like that ?

this way is difficult to distinguish, you need to check the running processes sorted by user to understand what pool belongs to the user.

Ok, the template idea makes sense - I'll put this on our TODO list, as it's closely related to general editing of those .conf files.

As to why the numeric names - this is intentional, as those are Virtualmin's internal domain IDs which never change even if the domain is renamed.

This is still and issue in 6.15. Just dealt with a server swamping with PHP-FPM child processes. The 'pm.max_children' is still set to 9999 by default in all PHP-FPM pools. The default is the sample PHP-FPM pool template is 'pm.max_children = 5'.

I can't see any global way to fix this, unless adding it to "Additional FPM pool options' will override the default pool setting? Or is there a template somewhere to edit? I can't find any setting for this at the per-site level either. Though you can 'manually edit config' under Services -> PHP-FPM options. Ideally there would get a sensible default value and a global way to change/limit that.