Skip to content

Commit

Permalink
Merge pull request #275 from gini/worker_rlimit_nofile
Browse files Browse the repository at this point in the history
New parameter worker_rlimit_nofile
  • Loading branch information
James Fryman committed Mar 17, 2014
2 parents e59468a + 04b6c3d commit 15506a5
Show file tree
Hide file tree
Showing 5 changed files with 14 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 @@ -16,6 +16,7 @@
class nginx::config(
$worker_processes = $nginx::params::nx_worker_processes,
$worker_connections = $nginx::params::nx_worker_connections,
$worker_rlimit_nofile = $nginx::params::nx_worker_rlimit_nofile,
$confd_purge = $nginx::params::nx_confd_purge,
$vhost_purge = $nginx::params::nx_vhost_purge,
$server_tokens = $nginx::params::nx_server_tokens,
Expand Down
5 changes: 5 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
class nginx (
$worker_processes = $nginx::params::nx_worker_processes,
$worker_connections = $nginx::params::nx_worker_connections,
$worker_rlimit_nofile = $nginx::params::nx_worker_rlimit_nofile,
$package_name = $nginx::params::package_name,
$package_ensure = $nginx::params::package_ensure,
$package_source = $nginx::params::package_source,
Expand Down Expand Up @@ -71,6 +72,9 @@
if (!is_integer($worker_connections)) {
fail('$worker_connections must be an integer.')
}
if (!is_integer($worker_rlimit_nofile)) {
fail('$worker_rlimit_nofile must be an integer.')
}
validate_string($package_name)
validate_string($package_ensure)
validate_string($package_source)
Expand Down Expand Up @@ -121,6 +125,7 @@
class { 'nginx::config':
worker_processes => $worker_processes,
worker_connections => $worker_connections,
worker_rlimit_nofile => $worker_rlimit_nofile,
proxy_set_header => $proxy_set_header,
proxy_http_version => $proxy_http_version,
proxy_cache_path => $proxy_cache_path,
Expand Down
1 change: 1 addition & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
$nx_vhost_purge = false
$nx_worker_processes = 1
$nx_worker_connections = 1024
$nx_worker_rlimit_nofile = 1024
$nx_types_hash_max_size = 1024
$nx_types_hash_bucket_size = 512
$nx_names_hash_bucket_size = 64
Expand Down
6 changes: 6 additions & 0 deletions spec/classes/config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -161,6 +161,12 @@
:value => '4',
:match => 'worker_processes 4;',
},
{
:title => 'should set worker_rlimit_nofile',
:attr => 'worker_rlimit_nofile',
:value => '10000',
:match => 'worker_rlimit_nofile 10000;',
},
{
:title => 'should set error_log',
:attr => 'nginx_error_log',
Expand Down
1 change: 1 addition & 0 deletions templates/conf.d/nginx.conf.erb
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
user <%= scope.lookupvar('nginx::config::nx_daemon_user') %>;
worker_processes <%= @worker_processes %>;
worker_rlimit_nofile <%= @worker_rlimit_nofile %>;

error_log <%= @nginx_error_log %>;
pid <%= scope.lookupvar('nginx::params::nx_pid')%>;
Expand Down

0 comments on commit 15506a5

Please sign in to comment.