pupy/services/proxy/limits_linux.go

21 lines
364 B
Go
Raw Normal View History

2018-02-01 09:48:35 +00:00
// +build linux
package main
import (
log "github.com/sirupsen/logrus"
"syscall"
)
func init() {
log.Warning("Set rlimits")
limits := &syscall.Rlimit{}
err := syscall.Getrlimit(syscall.RLIMIT_NOFILE, limits)
if err != nil {
log.Fatalln("Couldn't get rlimit value: ", err)
}
limits.Cur = limits.Max
syscall.Setrlimit(syscall.RLIMIT_NOFILE, limits)
}