Show warning in case of low number of connections

This commit is contained in:
Manuel de Brito Fontes 2016-07-12 00:40:45 -04:00
parent a34124be9d
commit b4f1b7c0f5

View file

@ -224,9 +224,11 @@ func diff(b1, b2 []byte) (data []byte, err error) {
// sysctlSomaxconn returns the value of net.core.somaxconn, i.e. // sysctlSomaxconn returns the value of net.core.somaxconn, i.e.
// maximum number of connections that can be queued for acceptance // maximum number of connections that can be queued for acceptance
// http://nginx.org/en/docs/http/ngx_http_core_module.html#listen
func sysctlSomaxconn() int { func sysctlSomaxconn() int {
maxConns, err := sysctl.GetSysctl("net.core.somaxconn") maxConns, err := sysctl.GetSysctl("net.core.somaxconn")
if err != nil || maxConns < 512 { if err != nil || maxConns < 512 {
glog.Warningf("system net.core.somaxconn=%v. Using NGINX default (511)", maxConns)
return 511 return 511
} }