php pm dynamic

This commit is contained in:
mwiegand 2022-06-23 21:35:30 +02:00
parent 9946edc6f3
commit 8285a12f00

View file

@ -132,6 +132,8 @@ def php_ini(metadata):
'php/www.conf', 'php/www.conf',
) )
def www_conf(metadata): def www_conf(metadata):
threads = metadata.get('vm/threads', metadata.get('vm/cores', 4))
return { return {
'php': { 'php': {
'www.conf': { 'www.conf': {
@ -141,11 +143,11 @@ def www_conf(metadata):
'listen.owner': 'www-data', 'listen.owner': 'www-data',
'listen.group': 'www-data', 'listen.group': 'www-data',
'pm': 'dynamic', 'pm': 'dynamic',
'pm.max_children': '32', 'pm.max_children': int(threads*2),
'pm.start_servers': '16', 'pm.start_servers': int(threads),
'pm.min_spare_servers': '8', 'pm.min_spare_servers': int(threads/2),
'pm.max_spare_servers': '16', 'pm.max_spare_servers': int(threads),
'pm.max_requests': '500', 'pm.max_requests': int(threads*32),
}, },
}, },
} }