Skip to content

Commit

Permalink
Avoid negative values configuring the max number of open files
Browse files Browse the repository at this point in the history
  • Loading branch information
aledbf committed Mar 30, 2017
1 parent 7526728 commit cf82f69
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controllers/nginx/pkg/cmd/controller/nginx.go
Original file line number Diff line number Diff line change
Expand Up @@ -370,6 +370,10 @@ func (n *NGINXController) OnUpdate(ingressCfg ingress.Configuration) ([]byte, er
wp = 1
}
maxOpenFiles := (sysctlFSFileMax() / wp) - 1024
if maxOpenFiles < 0 {
// this means the value of RLIMIT_NOFILE is too low.
maxOpenFiles = 1024
}

setHeaders := map[string]string{}
if cfg.ProxySetHeaders != "" {
Expand Down

0 comments on commit cf82f69

Please sign in to comment.