worker_connections should be less than worker_rlimit_nofile

This commit is contained in:
Elvin Efendi 2019-01-15 15:38:30 -05:00
parent d4d25f6fb4
commit 638f965a8f

View file

@ -22,6 +22,7 @@ import (
"errors" "errors"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
"math"
"net" "net"
"net/http" "net/http"
"os" "os"
@ -538,8 +539,9 @@ func (n *NGINXController) OnUpdate(ingressCfg ingress.Configuration) error {
} }
if cfg.MaxWorkerConnections == 0 { if cfg.MaxWorkerConnections == 0 {
klog.V(3).Infof("Adjusting MaxWorkerConnections variable to %d", cfg.MaxWorkerOpenFiles) maxWorkerConnections := int(math.Ceil(float64(cfg.MaxWorkerOpenFiles * 3.0 / 4)))
cfg.MaxWorkerConnections = cfg.MaxWorkerOpenFiles klog.V(3).Infof("Adjusting MaxWorkerConnections variable to %d", maxWorkerConnections)
cfg.MaxWorkerConnections = maxWorkerConnections
} }
setHeaders := map[string]string{} setHeaders := map[string]string{}