diff options
Diffstat (limited to 'lib/rainbows')
-rw-r--r-- | lib/rainbows/http_server.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/rainbows/http_server.rb b/lib/rainbows/http_server.rb index 21c5a05..02f3405 100644 --- a/lib/rainbows/http_server.rb +++ b/lib/rainbows/http_server.rb @@ -52,6 +52,13 @@ class Rainbows::HttpServer < Unicorn::HttpServer # 5: std{in,out,err} + heartbeat FD + per-process listener nofile = 5 + @worker_connections + LISTENERS.size trysetrlimit(:RLIMIT_NOFILE, nofile) + + case @use + when :ThreadSpawn, :ThreadPool, :ActorSpawn, + :CoolioThreadSpawn, :RevThreadSpawn, + :WriterThreadPool, :WriterThreadSpawn + trysetrlimit(:RLIMIT_NPROC, @worker_connections + LISTENERS.size + 1) + end super end |