php prformance tweaks

This commit is contained in:
mwiegand 2021-11-13 16:21:24 +01:00
parent d6e4cdb45a
commit 38e542c184
2 changed files with 33 additions and 12 deletions

View file

@ -100,3 +100,12 @@ zend.assertions = -1
[Date]
date.timezone = Europe/London
[opcache]
opcache.enable = 1
opcache.interned_strings_buffer = 32
opcache.max_accelerated_files = 20000
opcache.memory_consumption = 1024
opcache.save_comments = 1
opcache.validate_timestamps = 1
opcache.revalidate_freq = 60

View file

@ -1,22 +1,34 @@
defaults = {
'php': {
'post_max_size': '32G',
'www.conf': {
'user': 'www-data',
'group': 'www-data',
'listen': '/run/php/php7.4-fpm.sock',
'listen.owner': 'www-data',
'listen.group': 'www-data',
'pm': 'dynamic',
'pm.max_children': '5',
'pm.start_servers': '2',
'pm.min_spare_servers': '1',
'pm.max_spare_servers': '3',
},
},
}
@metadata_reactor.provides(
'php/www.conf',
)
def www_conf(metadata):
version = metadata.get('php/version')
return {
'php': {
'www.conf': {
'user': 'www-data',
'group': 'www-data',
'listen': f'/run/php/php{version}-fpm.sock',
'listen.owner': 'www-data',
'listen.group': 'www-data',
'pm': 'dynamic',
'pm.max_children': '80',
'pm.start_servers': '20',
'pm.min_spare_servers': '20',
'pm.max_spare_servers': '30',
'pm.max_requests': '500',
},
},
}
@metadata_reactor.provides(
'apt/packages',
)