Skip to content

Optimize configuration for Apache and PHP FPM

Credit: @sbuckpesch

Run ps_mem.py on you host and collect the values for apache and php-fpm processes.

The, download the apache_performance.xlsx spreadsheet, fill in the orange fields for your specific server and configure the green calculated values into the Ansible inventory for your host:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
apache_mpm_prefork:
  startservers: 40
  serverlimit: 11267
  minspareservers: 5
  maxspareservers: 10
  maxrequestworkers: 11267
  maxconnectionsperchild: 0

php_fpm_max_children: 3338
php_fpm_start_servers: 160
php_fpm_min_spare_servers: 80
php_fpm_max_spare_servers: 160
php_fpm_max_requests: 20000

Then roll-out the configuration to the host.


Last update: January 12, 2021 18:06:10