Merge pull request #3667 from Shopify/fix-worker-connection-calculation

worker_connections should be less (3/4th) than worker_rlimit_nofile
This commit is contained in:
Kubernetes Prow Robot 2019-02-06 15:11:20 -08:00 committed by GitHub
commit ef7d7cf7d1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -22,6 +22,7 @@ import (
"errors"
"fmt"
"io/ioutil"
"math"
"net"
"net/http"
"os"
@ -537,8 +538,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{}