Saltstack Official Apache Formula
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

52 lines
2.3KB

  1. # managed by saltstack
  2. {% set mpm_module = 'mpm_prefork' -%}
  3. {% set mpm_param = salt['pillar.get']('apache:mod_mpm_prefork', {}) -%}
  4. {% if pillar.get('apache:mod_mpm_worker') is defined -%}
  5. {% set mpm_module = 'mpm_worker' -%}
  6. {% set mpm_param = salt['pillar.get']('apache:mod_mpm_worker', {}) -%}
  7. {% else -%}
  8. {% endif -%}
  9. LoadModule {{ mpm_module }}_module modules/mod_{{ mpm_module }}.so
  10. # prefork MPM
  11. # StartServers: number of server processes to start
  12. # MinSpareServers: minimum number of server processes which are kept spare
  13. # ServerLimit: maximum number of server processes
  14. # MaxSpareServers: maximum number of server processes which are kept spare
  15. # MaxRequestWorkers: maximum number of server processes allowed to start
  16. # MaxConnectionsPerChild: maximum number of requests a server process serves
  17. <IfModule mpm_prefork_module>
  18. StartServers {{ mpm_param['start_servers'] | d('5') }}
  19. MaxRequestWorkers {{ mpm_param['max_request_workers'] | d('150') }}
  20. {%- if mpm_param['max_request_workers'] | d('150') >= 256 %}
  21. ServerLimit {{ mpm_param['max_request_workers'] | d('150') }}
  22. {%- endif %}
  23. MinSpareServers {{ mpm_param['min_spare_servers'] | d('5') }}
  24. MaxSpareServers {{ mpm_param['max_spare_servers'] | d('10') }}
  25. MaxConnectionsPerChild {{ mpm_param['max_connections_per_child'] | d('0') }}
  26. </IfModule>
  27. # worker MPM
  28. # StartServers: initial number of server processes to start
  29. # MinSpareThreads: minimum number of worker threads which are kept spare
  30. # MaxSpareThreads: maximum number of worker threads which are kept spare
  31. # ThreadsPerChild: constant number of worker threads in each server process
  32. # MaxRequestWorkers: maximum number of worker threads
  33. # MaxConnectionsPerChild: maximum number of connections a server process serves
  34. # before terminating
  35. <IfModule mpm_worker_module>
  36. StartServers {{ mpm_param['start_servers'] | d('2') }}
  37. MaxRequestWorkers {{ mpm_param['max_request_workers'] | d('150') }}
  38. MinSpareThreads {{ mpm_param['min_spare_threads'] | d('25') }}
  39. MaxSpareThreads {{ mpm_param['max_spare_threads'] | d('75') }}
  40. ThreadLimit {{ mpm_param['thread_limit'] | d('64') }}
  41. ThreadsPerChild {{ mpm_param['threads_per_child'] | d('25') }}
  42. MaxConnectionsPerChild {{ mpm_param['max_connections_per_child'] | d('0') }}
  43. </IfModule>
  44. # vim: syntax=apache ts=4 sw=4 sts=4 sr noet