Skip to content

Commit

Permalink
[keepalive_requests] added keepalive_requests parameter in nginx.conf
Browse files Browse the repository at this point in the history
set it to default value of 100 as shown in nginx config
Require this parameter as default value results in a huge number of TIME_WAIT connections with high QPS applications hitting nginx
The check has been copied from the keepalive_timeout parameter
  • Loading branch information
Shoeb Chikte committed Sep 10, 2016
1 parent 6bdf457 commit 2a5a0ca
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions manifests/config.pp
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@
$http_tcp_nodelay = 'on',
$http_tcp_nopush = 'off',
$keepalive_timeout = '65',
$keepalive_requests = '100',
$log_format = {},
$mail = false,
$stream = false,
Expand Down
3 changes: 3 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
$http_tcp_nodelay = undef,
$http_tcp_nopush = undef,
$keepalive_timeout = undef,
$keepalive_requests = undef,
$mail = undef,
$multi_accept = undef,
$names_hash_bucket_size = undef,
Expand Down Expand Up @@ -164,6 +165,7 @@
$http_tcp_nodelay or
$http_tcp_nopush or
$keepalive_timeout or
$keepalive_requests or
$logdir or
$log_format or
$mail or
Expand Down Expand Up @@ -247,6 +249,7 @@
http_tcp_nodelay => $http_tcp_nodelay,
http_tcp_nopush => $http_tcp_nopush,
keepalive_timeout => $keepalive_timeout,
keepalive_requests => $keepalive_requests,
log_dir => $logdir,
log_format => $log_format,
mail => $mail,
Expand Down
12 changes: 12 additions & 0 deletions spec/classes/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,12 @@
value: '123',
match: ' keepalive_timeout 123;'
},
{
title: 'should set keepalive_requests',
attr: 'keepalive_requests',
value: '345',
match: ' keepalive_requests 345;'
},
{
title: 'should set tcp_nodelay',
attr: 'http_tcp_nodelay',
Expand Down Expand Up @@ -458,6 +464,12 @@
value: '123',
match: ' keepalive_timeout 123;'
},
{
title: 'should set keepalive_requests',
attr: 'keepalive_requests',
value: '345',
match: ' keepalive_requests 345;'
},
{
title: 'should set mail',
attr: 'mail',
Expand Down
1 change: 1 addition & 0 deletions templates/conf.d/nginx.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ http {
server_names_hash_max_size <%= @names_hash_max_size %>;

keepalive_timeout <%= @keepalive_timeout %>;
keepalive_requests <%= @keepalive_requests %>;
tcp_nodelay <%= @http_tcp_nodelay %>;

<% if @gzip == 'on' -%>
Expand Down

0 comments on commit 2a5a0ca

Please sign in to comment.