server: Set rLimit properly to the max. (#1676)

4000 is too small to handle 500 go-routines.

Fixes #1666
master
Harshavardhana 8 years ago
parent 2da34e4668
commit b69a97aed4
  1. 7
      server-rlimit-nix.go

@ -29,9 +29,10 @@ func setMaxOpenFiles() error {
if err != nil { if err != nil {
return err return err
} }
// Safe limit to be set on all platforms. // Set the current limit to Max, it is usually around 4096.
rLimit.Max = 4000 // TO increate this limit further user has to manually edit
rLimit.Cur = 4000 // `/etc/security/limits.conf`
rLimit.Cur = rLimit.Max
err = syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit) err = syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit)
if err != nil { if err != nil {
return err return err

Loading…
Cancel
Save