Skip to content

Commit

Permalink
Merge pull request #703 from attachmentgenie/MaxKeepAliveRequests
Browse files Browse the repository at this point in the history
turning MaxKeepAliveRequests into a variable
  • Loading branch information
igalic committed May 1, 2014
2 parents 770c111 + 94f2d77 commit ce04ebe
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 2 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -306,6 +306,10 @@ Enables persistent connections.

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

#####`max_keepalive_requests`

Sets the limit of the number of requests allowed per connection when KeepAlive is on. Defaults to '100'.

#####`log_level`

Changes the verbosity level of the error log. Defaults to 'warn'. Valid values are 'emerg', 'alert', 'crit', 'error', 'warn', 'notice', 'info', or 'debug'.
Expand Down
2 changes: 2 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
$group = $::apache::params::group,
$keepalive = $::apache::params::keepalive,
$keepalive_timeout = $::apache::params::keepalive_timeout,
$max_keepalive_requests = $apache::params::max_keepalive_requests,
$logroot = $::apache::params::logroot,
$log_level = $::apache::params::log_level,
$log_formats = {},
Expand Down Expand Up @@ -270,6 +271,7 @@
# - $apxs_workaround
# - $keepalive
# - $keepalive_timeout
# - $max_keepalive_requests
# - $server_root
# - $server_tokens
# - $server_signature
Expand Down
3 changes: 3 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@
$conf_template = 'apache/httpd.conf.erb'
$keepalive = 'Off'
$keepalive_timeout = 15
$max_keepalive_requests = 100
$fastcgi_lib_path = undef
$mime_support_package = 'mailcap'
$mime_types_config = '/etc/mime.types'
Expand Down Expand Up @@ -141,6 +142,7 @@
$conf_template = 'apache/httpd.conf.erb'
$keepalive = 'Off'
$keepalive_timeout = 15
$max_keepalive_requests = 100
$fastcgi_lib_path = '/var/lib/apache2/fastcgi'
$mime_support_package = 'mime-support'
$mime_types_config = '/etc/mime.types'
Expand Down Expand Up @@ -199,6 +201,7 @@
$conf_template = 'apache/httpd.conf.erb'
$keepalive = 'Off'
$keepalive_timeout = 15
$max_keepalive_requests = 100
$fastcgi_lib_path = undef # TODO: revisit
$mime_support_package = 'misc/mime-support'
$mime_types_config = '/usr/local/etc/mime.types'
Expand Down
3 changes: 2 additions & 1 deletion spec/acceptance/apache_parameters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ class { 'apache':
describe 'keepalive' do
describe 'setup' do
it 'applies cleanly' do
pp = "class { 'apache': keepalive => 'On', keepalive_timeout => '30' }"
pp = "class { 'apache': keepalive => 'On', keepalive_timeout => '30', max_keepalive_requests => '200' }"
apply_manifest(pp, :catch_failures => true)
end
end
Expand All @@ -321,6 +321,7 @@ class { 'apache':
it { should be_file }
it { should contain 'KeepAlive On' }
it { should contain 'KeepAliveTimeout 30' }
it { should contain 'MaxKeepAliveRequests 200' }
end
end

Expand Down
2 changes: 1 addition & 1 deletion templates/httpd.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ServerRoot "<%= @server_root %>"
PidFile <%= @pidfile %>
Timeout <%= @timeout %>
KeepAlive <%= @keepalive %>
MaxKeepAliveRequests 100
MaxKeepAliveRequests <%= @max_keepalive_requests %>
KeepAliveTimeout <%= @keepalive_timeout %>

User <%= @user %>
Expand Down

0 comments on commit ce04ebe

Please sign in to comment.