about summary refs log tree commit homepage
path: root/lib/rainbows/http_server.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rainbows/http_server.rb')
-rw-r--r--lib/rainbows/http_server.rb7
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