diff --git a/manifests/mod/event.pp b/manifests/mod/event.pp index cb7ed96cd..f2b28fde2 100644 --- a/manifests/mod/event.pp +++ b/manifests/mod/event.pp @@ -1,12 +1,16 @@ class apache::mod::event ( - $startservers = '2', - $maxclients = '150', - $minsparethreads = '25', - $maxsparethreads = '75', - $threadsperchild = '25', - $maxrequestsperchild = '0', - $serverlimit = '25', - $apache_version = $::apache::apache_version, + $startservers = '2', + $maxclients = '150', + $minsparethreads = '25', + $maxsparethreads = '75', + $threadsperchild = '25', + $maxrequestsperchild = '0', + $serverlimit = '25', + $apache_version = $::apache::apache_version, + $threadlimit = '64', + $listenbacklog = '511', + $maxrequestworkers = '256', + $maxconnectionsperchild = '0', ) { if defined(Class['apache::mod::itk']) { fail('May not include both apache::mod::event and apache::mod::itk on the same node') diff --git a/spec/classes/mod/event_spec.rb b/spec/classes/mod/event_spec.rb index 3061ca9b1..f85f4d328 100644 --- a/spec/classes/mod/event_spec.rb +++ b/spec/classes/mod/event_spec.rb @@ -34,11 +34,44 @@ } end + it { is_expected.to contain_class("apache::params") } it { is_expected.not_to contain_apache__mod('event') } it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file') } it { is_expected.to contain_file("/etc/apache2/mods-enabled/event.conf").with_ensure('link') } + context "Test mpm_event params" do + let :params do + { + :serverlimit => '0', + :startservers => '1', + :maxclients => '2', + :minsparethreads => '3', + :maxsparethreads => '4', + :threadsperchild => '5', + :maxrequestsperchild => '6', + :threadlimit => '7', + :listenbacklog => '8', + :maxrequestworkers => '9', + :maxconnectionsperchild => '10', + } + end + + it { is_expected.to contain_file("/etc/apache2/mods-available/event.conf").with_ensure('file') + .with_content(/^\s*ServerLimit\s*0/) + .with_content(/^\s*StartServers\s*1/) + .with_content(/^\s*MaxClients\s*2/) + .with_content(/^\s*MinSpareThreads\s*3/) + .with_content(/^\s*MaxSpareThreads\s*4/) + .with_content(/^\s*ThreadsPerChild\s*5/) + .with_content(/^\s*MaxRequestsPerChild\s*6/) + .with_content(/^\s*ThreadLimit\s*7/) + .with_content(/^\s*ListenBacklog\s*8/) + .with_content(/^\s*MaxRequestWorkers\s*9/) + .with_content(/^\s*MaxConnectionsPerChild\s*10/) + } + end + context "with Apache version < 2.4" do let :params do { diff --git a/templates/mod/event.conf.erb b/templates/mod/event.conf.erb index 40099543d..e7ef7ea6e 100644 --- a/templates/mod/event.conf.erb +++ b/templates/mod/event.conf.erb @@ -6,4 +6,8 @@ MaxSpareThreads <%= @maxsparethreads %> ThreadsPerChild <%= @threadsperchild %> MaxRequestsPerChild <%= @maxrequestsperchild %> + ThreadLimit <%= @threadlimit %> + ListenBacklog <%= @listenbacklog %> + MaxRequestWorkers <%= @maxrequestworkers %> + MaxConnectionsPerChild <%= @maxconnectionsperchild %>