about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-11-13 18:39:29 -0800
committerEric Wong <normalperson@yhbt.net>2009-11-13 18:40:02 -0800
commitea58c416ac352063ede2d932c422745fe090bb5e (patch)
treec13504d9b6d0b9eea564e7d2be777e5ff8598dae
parent5831a1ce5ba5be7d9f55f36bfe9714715b0ecdf8 (diff)
downloadunicorn-ea58c416ac352063ede2d932c422745fe090bb5e.tar.gz
Some of this based on Suraj Kurapati's comments on
the mailing list.
-rw-r--r--lib/unicorn/configurator.rb20
1 files changed, 14 insertions, 6 deletions
diff --git a/lib/unicorn/configurator.rb b/lib/unicorn/configurator.rb
index dcbf39a..d68897b 100644
--- a/lib/unicorn/configurator.rb
+++ b/lib/unicorn/configurator.rb
@@ -7,7 +7,7 @@ module Unicorn
 
   # Implements a simple DSL for configuring a Unicorn server.
   #
-  # Example (when used with the unicorn config file):
+  # Example (when used with the Unicorn config file):
   #   worker_processes 4
   #   working_directory "/path/to/deploy/app/current"
   #   listen '/tmp/my_app.sock', :backlog => 1
@@ -22,12 +22,16 @@ module Unicorn
   #     GC.copy_on_write_friendly = true
   #
   #   before_fork do |server, worker|
-  #     # the following is recomended for Rails + "preload_app true"
+  #     # the following is highly recomended for Rails + "preload_app true"
   #     # as there's no need for the master process to hold a connection
   #     defined?(ActiveRecord::Base) and
   #       ActiveRecord::Base.connection.disconnect!
   #
-  #     # the following allows a new master process to incrementally
+  #     # The following is only recommended for memory/DB-constrained
+  #     # installations.  It is not needed if your system can house
+  #     # twice as many worker_processes as you have configured.
+  #
+  #     # This allows a new master process to incrementally
   #     # phase out the old master process with SIGTTOU to avoid a
   #     # thundering herd (especially in the "preload_app false" case)
   #     # when doing a transparent upgrade.  The last worker spawned
@@ -41,7 +45,7 @@ module Unicorn
   #       end
   #     end
   #
-  #     # optionally throttle the master from forking too quickly by sleeping
+  #     # *optionally* throttle the master from forking too quickly by sleeping
   #     sleep 1
   #   end
   #
@@ -50,7 +54,7 @@ module Unicorn
   #     addr = "127.0.0.1:#{9293 + worker.nr}"
   #     server.listen(addr, :tries => -1, :delay => 5, :tcp_nopush => true)
   #
-  #     # the following is required for Rails + "preload_app true",
+  #     # the following is *required* for Rails + "preload_app true",
   #     defined?(ActiveRecord::Base) and
   #       ActiveRecord::Base.establish_connection
   #
@@ -203,7 +207,11 @@ module Unicorn
     end
 
     # sets the current number of worker_processes to +nr+.  Each worker
-    # process will serve exactly one client at a time.
+    # process will serve exactly one client at a time.  You can
+    # increment or decrement this value at runtime by sending SIGTTIN
+    # or SIGTTOU respectively to the master process without reloading
+    # the rest of your Unicorn configuration.  See the SIGNALS document
+    # for more information.
     def worker_processes(nr)
       Integer === nr or raise ArgumentError,
                              "not an integer: worker_processes=#{nr.inspect}"