diff options
author | Eric Wong <normalperson@yhbt.net> | 2011-04-09 18:58:23 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2011-04-21 14:50:03 -0700 |
commit | 63b3b40abf054bce2846bc9e36770a6ed2791a8b (patch) | |
tree | c027c6d38a41763a5bfeb63d208673050aefced6 /lib | |
parent | 066bbf930d023ecf61ed4af363aebadbce2c51db (diff) | |
download | rainbows-63b3b40abf054bce2846bc9e36770a6ed2791a8b.tar.gz |
Might as well, threads are free and cheap on 64-bit
Diffstat (limited to 'lib')
-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 |