diff --git a/manifests/init.pp b/manifests/init.pp index b1c1787f5..82f2ab0d8 100644 --- a/manifests/init.pp +++ b/manifests/init.pp @@ -197,6 +197,8 @@ # @param saml_sp_key The location of the SAML Service Provider Key file. # @param saml_sp_cert The location of the SAML Service Provider Certificate. # @param saml_idp_cert The location of the SAML Identity Provider Certificate. +# @param fpm_max_requests The number of requests each child process should execute before respawning. +# @param fpm_max_spare_servers The desired maximum number of idle server processes. # @param saml_settings A hash of additional SAML SSO settings. # @example Single host setup: # class { 'zabbix': @@ -341,6 +343,8 @@ Optional[Stdlib::Absolutepath] $saml_sp_key = $zabbix::params::saml_sp_key, Optional[Stdlib::Absolutepath] $saml_sp_cert = $zabbix::params::saml_sp_cert, Optional[Stdlib::Absolutepath] $saml_idp_cert = $zabbix::params::saml_idp_cert, + Optional[Integer[1, 10000]] $fpm_max_requests = $zabbix::params::fpm_max_requests, + Optional[Integer[1, 1000]] $fpm_max_spare_servers = $zabbix::params::fpm_max_spare_servers, Hash[String[1], Variant[ScalarData, Hash]] $saml_settings = $zabbix::params::saml_settings, ) inherits zabbix::params { class { 'zabbix::web': @@ -388,6 +392,8 @@ saml_sp_cert => $saml_sp_cert, saml_idp_cert => $saml_idp_cert, saml_settings => $saml_settings, + fpm_max_requests => $fpm_max_requests, + fpm_max_spare_servers => $fpm_max_spare_servers, manage_selinux => $manage_selinux, require => Class['zabbix::server'], } diff --git a/manifests/params.pp b/manifests/params.pp index 99b5d09b8..c8122d9e6 100644 --- a/manifests/params.pp +++ b/manifests/params.pp @@ -189,6 +189,7 @@ $saml_sp_cert = undef $saml_idp_cert = undef $saml_settings = {} + $fpm_max_spare_servers = 35 # Zabbix-server $server_alertscriptspath = '/etc/zabbix/alertscripts' diff --git a/manifests/web.pp b/manifests/web.pp index 678f0d77f..15fc60e5e 100644 --- a/manifests/web.pp +++ b/manifests/web.pp @@ -139,6 +139,8 @@ Optional[Stdlib::Absolutepath] $saml_sp_key = $zabbix::params::saml_sp_key, Optional[Stdlib::Absolutepath] $saml_sp_cert = $zabbix::params::saml_sp_cert, Optional[Stdlib::Absolutepath] $saml_idp_cert = $zabbix::params::saml_idp_cert, + Optional[Integer[1, 1000]] $fpm_max_requests = $zabbix::params::fpm_max_requests, + Optional[Integer[1, 100]] $fpm_max_spare_servers = $zabbix::params::fpm_max_spare_servers, Hash[String[1], Variant[ScalarData, Hash]] $saml_settings = $zabbix::params::saml_settings, $puppetgem = $zabbix::params::puppetgem, Boolean $manage_selinux = $zabbix::params::manage_selinux, diff --git a/templates/web/php-fpm.d.zabbix.conf.epp b/templates/web/php-fpm.d.zabbix.conf.epp index a8a8fff80..c4f17e057 100644 --- a/templates/web/php-fpm.d.zabbix.conf.epp +++ b/templates/web/php-fpm.d.zabbix.conf.epp @@ -11,7 +11,10 @@ pm = dynamic pm.max_children = 50 pm.start_servers = 5 pm.min_spare_servers = 5 -pm.max_spare_servers = 35 +pm.max_spare_servers = <%= $zabbix::web::fpm_max_spare_servers %> +<% if $zabbix::web::fpm_max_requests { %> +pm.max_requests = <%= $zabbix::web::fpm_max_requests %> +<% } %> php_value[session.save_handler] = files php_value[session.save_path] = /var<%= $zabbix::web::fpm_scl_prefix %>/lib/php/session/