diff options
author | evanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9> | 2007-09-24 16:26:38 +0000 |
---|---|---|
committer | evanweaver <evanweaver@19e92222-5c0b-0410-8929-a290d50e31e9> | 2007-09-24 16:26:38 +0000 |
commit | fd9a2271ffac8073c3f02986b906d782f6b249b7 (patch) | |
tree | 0076094d017d69ebbef26c7a40132e5db6e78243 /lib/mongrel | |
parent | e63cf0903bfee6b3fbb61b3597ed49f073f9984d (diff) | |
download | unicorn-fd9a2271ffac8073c3f02986b906d782f6b249b7.tar.gz |
git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@624 19e92222-5c0b-0410-8929-a290d50e31e9
Diffstat (limited to 'lib/mongrel')
-rw-r--r-- | lib/mongrel/configurator.rb | 10 | ||||
-rw-r--r-- | lib/mongrel/handlers.rb | 1 |
2 files changed, 7 insertions, 4 deletions
diff --git a/lib/mongrel/configurator.rb b/lib/mongrel/configurator.rb index 4fd81d6..9886634 100644 --- a/lib/mongrel/configurator.rb +++ b/lib/mongrel/configurator.rb @@ -119,8 +119,9 @@ module Mongrel # # * :host => Host name to bind. # * :port => Port to bind. - # * :num_processors => The maximum number of concurrent threads allowed. (950 default) - # * :timeout => 1/100th of a second timeout between requests. (10 is 1/10th, 0 is timeout) + # * :num_processors => The maximum number of concurrent threads allowed. + # * :throttle => Time to pause (in hundredths of a second) between accepting clients. + # * :timeout => Time to wait (in seconds) before killing a stalled thread. # * :user => User to change to, must have :group as well. # * :group => Group to change to, must have :user as well. # @@ -128,9 +129,10 @@ module Mongrel raise "Cannot call listener inside another listener block." if (@listener or @listener_name) ops = resolve_defaults(options) ops[:num_processors] ||= 950 - ops[:timeout] ||= 0 + ops[:throttle] ||= 0 + ops[:timeout] ||= 60 - @listener = Mongrel::HttpServer.new(ops[:host], ops[:port].to_i, ops[:num_processors].to_i, ops[:timeout].to_i) + @listener = Mongrel::HttpServer.new(ops[:host], ops[:port].to_i, ops[:num_processors].to_i, ops[:throttle].to_i, ops[:timeout].to_i) @listener_name = "#{ops[:host]}:#{ops[:port]}" @listeners[@listener_name] = @listener diff --git a/lib/mongrel/handlers.rb b/lib/mongrel/handlers.rb index be7860a..60472a8 100644 --- a/lib/mongrel/handlers.rb +++ b/lib/mongrel/handlers.rb @@ -374,6 +374,7 @@ module Mongrel results << table("settings", [ ["host",listener.host], ["port",listener.port], + ["throttle",listener.throttle], ["timeout",listener.timeout], ["workers max",listener.num_processors], ]) |