Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#429 Added new map_hash_bucket_size and map_hash_max_size paramater #430

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ pkg/
Gemfile.lock
spec/fixtures/
/metadata.json
/.idea
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be removed

10 changes: 10 additions & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,8 @@
$multi_accept = $nginx::params::nx_multi_accept,
$names_hash_bucket_size = $nginx::params::nx_names_hash_bucket_size,
$names_hash_max_size = $nginx::params::nx_names_hash_max_size,
$map_hash_bucket_size = $nginx::params::nx_map_hash_bucket_size,
$map_hash_max_size = $nginx::params::nx_map_hash_max_size,
$nginx_error_log = $nginx::params::nx_nginx_error_log,
$nginx_locations = {},
$nginx_mailhosts = {},
Expand Down Expand Up @@ -165,6 +167,12 @@
if (!is_integer($names_hash_max_size)) {
fail('$names_hash_max_size must be an integer.')
}
if (!is_integer($map_hash_bucket_size)) {
fail('$map_hash_bucket_size must be an integer.')
}
if (!is_integer($map_hash_max_size)) {
fail('$map_hash_max_size must be an integer.')
}
validate_string($proxy_buffers)
validate_string($proxy_buffer_size)
if ($http_cfg_append != false) {
Expand Down Expand Up @@ -221,6 +229,8 @@
multi_accept => $multi_accept,
names_hash_bucket_size => $names_hash_bucket_size,
names_hash_max_size => $names_hash_max_size,
map_hash_bucket_size => $map_hash_bucket_size,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This creates an error because the new parameters haven't been added to the nginx::config class.

map_hash_max_size => $map_hash_max_size,
nginx_error_log => $nginx_error_log,
pid => $pid,
proxy_buffers => $proxy_buffers,
Expand Down
2 changes: 2 additions & 0 deletions manifests/params.pp
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
$nx_types_hash_max_size = 1024
$nx_types_hash_bucket_size = 512
$nx_names_hash_bucket_size = 64
$nx_map_hash_bucket_size = 64
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

64 is not always an appropriate default since map_hash_bucket_size has a dynamic default based on the processor's cache line size. Please set this to undef in params.pp and add logic to the template so map_hash_bucket_size is only added to the config when set by the user.

$nx_map_hash_max_size = 2048
$nx_names_hash_max_size = 512
$nx_multi_accept = off
# One of [kqueue|rtsig|epoll|/dev/poll|select|poll|eventport]
Expand Down
3 changes: 3 additions & 0 deletions templates/conf.d/nginx.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ http {
server_names_hash_bucket_size <%= @names_hash_bucket_size %>;
server_names_hash_max_size <%= @names_hash_max_size %>;

map_hash_bucket_size <%= @map_hash_bucket_size %>;
map_hash_max_size <%= @map_hash_max_size %>;

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

Expand Down