From b69a97aed4461cf8ad07a28717e4a3232bad26d7 Mon Sep 17 00:00:00 2001 From: Harshavardhana Date: Wed, 18 May 2016 11:34:24 -0700 Subject: [PATCH] server: Set rLimit properly to the max. (#1676) 4000 is too small to handle 500 go-routines. Fixes #1666 --- server-rlimit-nix.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/server-rlimit-nix.go b/server-rlimit-nix.go index 2f7eba463..a70ad7074 100644 --- a/server-rlimit-nix.go +++ b/server-rlimit-nix.go @@ -29,9 +29,10 @@ func setMaxOpenFiles() error { if err != nil { return err } - // Safe limit to be set on all platforms. - rLimit.Max = 4000 - rLimit.Cur = 4000 + // Set the current limit to Max, it is usually around 4096. + // TO increate this limit further user has to manually edit + // `/etc/security/limits.conf` + rLimit.Cur = rLimit.Max err = syscall.Setrlimit(syscall.RLIMIT_NOFILE, &rLimit) if err != nil { return err