Fix MaxWorkerOpenFiles calculation on high cores nodes (#7107)
* Fix MaxWorkerOpenFiles calculation on high cores nodes * Add e2e test for rlimit_nofile * Fix doc for max-worker-open-files
This commit is contained in:
parent
8328b532f7
commit
4bdb5538a4
3 changed files with 60 additions and 7 deletions
|
|
@ -512,12 +512,7 @@ func (n NGINXController) generateTemplate(cfg ngx_config.Configuration, ingressC
|
|||
if cfg.MaxWorkerOpenFiles == 0 {
|
||||
// the limit of open files is per worker process
|
||||
// and we leave some room to avoid consuming all the FDs available
|
||||
wp, err := strconv.Atoi(cfg.WorkerProcesses)
|
||||
klog.V(3).InfoS("Worker processes", "count", wp)
|
||||
if err != nil {
|
||||
wp = 1
|
||||
}
|
||||
maxOpenFiles := (rlimitMaxNumFiles() / wp) - 1024
|
||||
maxOpenFiles := rlimitMaxNumFiles() - 1024
|
||||
klog.V(3).InfoS("Maximum number of open file descriptors", "value", maxOpenFiles)
|
||||
if maxOpenFiles < 1024 {
|
||||
// this means the value of RLIMIT_NOFILE is too low.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue