Add an option to automatically set worker_connections based on worker_rlimit_nofile

This commit is contained in:
ramnes 2018-12-27 17:24:09 +01:00
parent 5119f64e5c
commit bf7b5ebd81
4 changed files with 38 additions and 19 deletions

View file

@ -29,9 +29,7 @@ worker_processes {{ $cfg.WorkerProcesses }};
worker_cpu_affinity {{ $cfg.WorkerCPUAffinity }};
{{ end }}
{{ if ne .MaxOpenFiles 0 }}
worker_rlimit_nofile {{ .MaxOpenFiles }};
{{ end }}
worker_rlimit_nofile {{ $cfg.MaxWorkerOpenFiles }};
{{/* http://nginx.org/en/docs/ngx_core_module.html#worker_shutdown_timeout */}}
{{/* avoid waiting too long during a reload */}}