From 255c8fb5aebba36cf4e4cf03810c919135c5ee5a Mon Sep 17 00:00:00 2001 From: normalperson Date: Sun, 2 Mar 2008 02:34:49 +0000 Subject: mongrel_rails: support -n/--num-procs command-line option Also added "num_procs" support in the config file as an alias to "num_processors" to make it easier to migrate configs from/to mongrel_cluster. ref: http://mongrel.rubyforge.org/ticket/14 git-svn-id: svn+ssh://rubyforge.org/var/svn/mongrel/trunk@987 19e92222-5c0b-0410-8929-a290d50e31e9 --- bin/mongrel_rails | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bin/mongrel_rails b/bin/mongrel_rails index 6d80364..8bd99e0 100644 --- a/bin/mongrel_rails +++ b/bin/mongrel_rails @@ -28,7 +28,7 @@ module Mongrel ['-a', '--address ADDR', "Address to bind to", :@address, "0.0.0.0"], ['-l', '--log FILE', "Where to write log messages", :@log_file, "log/mongrel.log"], ['-P', '--pid FILE', "Where to write the PID", :@pid_file, "log/mongrel.pid"], - ['-n', '--num-procs INT', "Number of processors active before clients denied", :@num_procs, 1024], + ['-n', '--num-procs INT', "Number of processors active before clients denied", :@num_processors, 1024], ['-o', '--timeout TIME', "Time to wait (in seconds) before killing a stalled thread", :@timeout, 60], ['-t', '--throttle TIME', "Time to pause (in hundredths of a second) between accepting clients", :@throttle, 0], ['-m', '--mime PATH', "A YAML file that lists additional MIME types", :@mime_map, nil], @@ -170,6 +170,7 @@ module Mongrel key = key.to_s if config_keys.include?(key) key = 'address' if key == 'host' + key = 'num_processors' if key == 'num_procs' self.instance_variable_set("@#{key}", value) else failure "Unknown configuration setting: #{key}" @@ -180,13 +181,14 @@ module Mongrel def config_keys @config_keys ||= - %w(address host port cwd log_file pid_file environment docroot mime_map daemon debug includes config_script num_processors timeout throttle user group prefix) + %w(address host port cwd log_file pid_file environment docroot mime_map daemon debug includes config_script num_processors num_procs timeout throttle user group prefix) end def settings config_keys.inject({}) do |hash, key| value = self.instance_variable_get("@#{key}") key = 'host' if key == 'address' + key = 'num_processors' if key == 'num_procs' hash[key.to_sym] ||= value hash end -- cgit v1.2.3-24-ge0c7