Skip to content

Commit ce04ebe

Browse files
committed
Merge pull request #703 from attachmentgenie/MaxKeepAliveRequests
turning MaxKeepAliveRequests into a variable
2 parents 770c111 + 94f2d77 commit ce04ebe

5 files changed

Lines changed: 12 additions & 2 deletions

File tree

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,10 @@ Enables persistent connections.
306306

307307
Sets the amount of time the server will wait for subsequent requests on a persistent connection. Defaults to '15'.
308308

309+
#####`max_keepalive_requests`
310+
311+
Sets the limit of the number of requests allowed per connection when KeepAlive is on. Defaults to '100'.
312+
309313
#####`log_level`
310314

311315
Changes the verbosity level of the error log. Defaults to 'warn'. Valid values are 'emerg', 'alert', 'crit', 'error', 'warn', 'notice', 'info', or 'debug'.

manifests/init.pp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
$group = $::apache::params::group,
5050
$keepalive = $::apache::params::keepalive,
5151
$keepalive_timeout = $::apache::params::keepalive_timeout,
52+
$max_keepalive_requests = $apache::params::max_keepalive_requests,
5253
$logroot = $::apache::params::logroot,
5354
$log_level = $::apache::params::log_level,
5455
$log_formats = {},
@@ -270,6 +271,7 @@
270271
# - $apxs_workaround
271272
# - $keepalive
272273
# - $keepalive_timeout
274+
# - $max_keepalive_requests
273275
# - $server_root
274276
# - $server_tokens
275277
# - $server_signature

manifests/params.pp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
$conf_template = 'apache/httpd.conf.erb'
8686
$keepalive = 'Off'
8787
$keepalive_timeout = 15
88+
$max_keepalive_requests = 100
8889
$fastcgi_lib_path = undef
8990
$mime_support_package = 'mailcap'
9091
$mime_types_config = '/etc/mime.types'
@@ -141,6 +142,7 @@
141142
$conf_template = 'apache/httpd.conf.erb'
142143
$keepalive = 'Off'
143144
$keepalive_timeout = 15
145+
$max_keepalive_requests = 100
144146
$fastcgi_lib_path = '/var/lib/apache2/fastcgi'
145147
$mime_support_package = 'mime-support'
146148
$mime_types_config = '/etc/mime.types'
@@ -199,6 +201,7 @@
199201
$conf_template = 'apache/httpd.conf.erb'
200202
$keepalive = 'Off'
201203
$keepalive_timeout = 15
204+
$max_keepalive_requests = 100
202205
$fastcgi_lib_path = undef # TODO: revisit
203206
$mime_support_package = 'misc/mime-support'
204207
$mime_types_config = '/usr/local/etc/mime.types'

spec/acceptance/apache_parameters_spec.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ class { 'apache':
312312
describe 'keepalive' do
313313
describe 'setup' do
314314
it 'applies cleanly' do
315-
pp = "class { 'apache': keepalive => 'On', keepalive_timeout => '30' }"
315+
pp = "class { 'apache': keepalive => 'On', keepalive_timeout => '30', max_keepalive_requests => '200' }"
316316
apply_manifest(pp, :catch_failures => true)
317317
end
318318
end
@@ -321,6 +321,7 @@ class { 'apache':
321321
it { should be_file }
322322
it { should contain 'KeepAlive On' }
323323
it { should contain 'KeepAliveTimeout 30' }
324+
it { should contain 'MaxKeepAliveRequests 200' }
324325
end
325326
end
326327

templates/httpd.conf.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ ServerRoot "<%= @server_root %>"
88
PidFile <%= @pidfile %>
99
Timeout <%= @timeout %>
1010
KeepAlive <%= @keepalive %>
11-
MaxKeepAliveRequests 100
11+
MaxKeepAliveRequests <%= @max_keepalive_requests %>
1212
KeepAliveTimeout <%= @keepalive_timeout %>
1313

1414
User <%= @user %>

0 commit comments

Comments
 (0)