about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <normalperson@yhbt.net>2009-11-23 23:46:16 -0800
committerEric Wong <normalperson@yhbt.net>2009-11-23 23:49:31 -0800
commit3cdef34a0beb530b885013530cca239c3e613634 (patch)
tree55ca773fd55c1d1b70d94dc832550b661cbc2ae0
parent9804cd197e64d22d613575b7a4db10daf01bb683 (diff)
downloadunicorn-3cdef34a0beb530b885013530cca239c3e613634.tar.gz
No point in repeating ourselves and having to deal with nested
comments + indentation in RDoc.  It's also easier for users
to just download the file than to copy-and-paste out of a
typical web browser.
-rw-r--r--lib/unicorn/configurator.rb60
1 files changed, 3 insertions, 57 deletions
diff --git a/lib/unicorn/configurator.rb b/lib/unicorn/configurator.rb
index e809b22..f6d13ab 100644
--- a/lib/unicorn/configurator.rb
+++ b/lib/unicorn/configurator.rb
@@ -7,63 +7,9 @@ module Unicorn
 
   # Implements a simple DSL for configuring a Unicorn server.
   #
-  # 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
-  #   listen 9292, :tcp_nopush => true
-  #   timeout 10
-  #   pid "/tmp/my_app.pid"
-  #
-  #   # combine REE with "preload_app true" for memory savings
-  #   # http://rubyenterpriseedition.com/faq.html#adapt_apps_for_cow
-  #   preload_app true
-  #   GC.respond_to?(:copy_on_write_friendly=) and
-  #     GC.copy_on_write_friendly = true
-  #
-  #   before_fork do |server, worker|
-  #     # 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 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
-  #     # will then kill off the old master process with a SIGQUIT.
-  #     old_pid = "#{server.config[:pid]}.oldbin"
-  #     if old_pid != server.pid
-  #       begin
-  #         sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU
-  #         Process.kill(sig, File.read(old_pid).to_i)
-  #       rescue Errno::ENOENT, Errno::ESRCH
-  #       end
-  #     end
-  #
-  #     # *optionally* throttle the master from forking too quickly by sleeping
-  #     sleep 1
-  #   end
-  #
-  #   after_fork do |server, worker|
-  #     # per-process listener ports for debugging/admin/migrations
-  #     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",
-  #     defined?(ActiveRecord::Base) and
-  #       ActiveRecord::Base.establish_connection
-  #
-  #     # if preload_app is true, then you may also want to check and
-  #     # restart any other shared sockets/descriptors such as Memcached,
-  #     # and Redis.  TokyoCabinet file handles are safe to reuse
-  #     # between any number of forked children (assuming your kernel
-  #     # correctly implements pread()/pwrite() system calls)
-  #   end
+  # See http://unicorn.bogomips.org/examples/unicorn.conf.rb for an
+  # example config file.  An example config file for use with nginx is
+  # also available at http://unicorn.bogomips.org/examples/nginx.conf
   class Configurator < Struct.new(:set, :config_file)
 
     # Default settings for Unicorn