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