1 = Unicorn: Rack HTTP server for Unix, fast clients and nothing else
5 * Designed for Rack, Unix, fast clients, and ease-of-debugging. We
6 cut out all things that are better-supported by nginx or Rack.
8 * Mostly written in Ruby, only the HTTP parser (stolen and trimmed
9 down from Mongrel) is written in C. Unicorn is compatible with
10 both Ruby 1.8 and 1.9. A pure-Ruby (but still Unix-only) version
13 * Process management: Unicorn will reap and restart workers that
14 die from broken apps. There is no need to manage multiple processes
15 or ports yourself. Unicorn can spawn and manage any fixed number of
16 worker processes you choose to scale to your backend.
18 * Load balancing is done entirely by the operating system kernel.
19 Requests never pile up behind a busy worker process.
21 * Does not care if your application is thread-safe or not, workers
22 all run within their own isolated address space and only serve one
25 * Supports all Rack applications, along with pre-Rack versions of
26 Ruby on Rails via a Rack wrapper.
28 * Builtin reopening of all log files in your application via
29 USR1 signal. This allows logrotate to rotate files atomically and
30 quickly via rename instead of the racy and slow copytruncate method.
31 Unicorn also takes steps to ensure multi-line log entries from one
32 request all stay within the same file.
34 * nginx-style binary re-execution without losing connections.
35 You can upgrade Unicorn, your entire application, libraries
36 and even your Ruby interpreter as long as Unicorn is
37 installed in the same path.
39 * before_fork and after_fork hooks in case your application
40 has special needs when dealing with forked processes. These
41 should not be needed when the "preload_app" directive is
44 * Can be used with copy-on-write-friendly memory management
45 to save memory (by setting "preload_app" to true).
47 * Able to listen on multiple interfaces including UNIX sockets,
48 each worker process can also bind to a private port via the
49 after_fork hook for easy debugging.
53 {Stable v0.8.4}[http://git.bogomips.org/cgit/unicorn.git/tag/?id=v0.8.4]
55 {Development v0.9.2}[http://git.bogomips.org/cgit/unicorn.git/tag/?id=v0.9.2]
59 Unicorn is copyright 2009 Eric Wong and contributors.
60 It is based on Mongrel and carries the same license:
62 Mongrel is copyright 2007 Zed A. Shaw and contributors. It is licensed
63 under the Ruby license and the GPL2. See the included LICENSE file for
66 Unicorn is 100% Free Software.
70 The library consists of a C extension so you'll need a C compiler
71 and Ruby development libraries/headers.
73 You may download the tarball from the Mongrel project page on Rubyforge
74 and run setup.rb after unpacking it:
76 http://rubyforge.org/frs/?group_id=1306
78 You may also install it via Rubygems on Rubyforge:
80 gem install unicorn -v0.8.4
82 You can get the latest source via git from the following locations
83 (these versions may not be stable):
85 git://git.bogomips.org/unicorn.git
86 http://git.bogomips.org/unicorn.git
87 git://repo.or.cz/unicorn.git (mirror)
88 http://repo.or.cz/r/unicorn.git (mirror)
90 You may browse the code from the web and download the latest snapshot
93 * http://git.bogomips.org/cgit/unicorn.git (cgit)
94 * http://repo.or.cz/w/unicorn.git (gitweb)
98 === non-Rails Rack applications
104 === for Rails applications (should work for all 1.2 or later versions)
110 Unicorn will bind to all interfaces on TCP port 8080 by default.
111 You may use the +--listen/-l+ switch to bind to a different
112 address:port or a UNIX socket.
114 === Configuration File(s)
116 Unicorn will look for the config.ru file used by rackup in APP_ROOT.
118 For deployments, it can use a config file for Unicorn-specific options
119 specified by the +--config-file/-c+ command-line switch. See
120 Unicorn::Configurator for the syntax of the Unicorn-specific options.
121 The default settings are designed for maximum out-of-the-box
122 compatibility with existing applications.
124 Most command-line options for other Rack applications (above) are also
125 supported. Run `unicorn -h` or `unicorn_rails -h` to see command-line
130 Like the creatures themselves, production deployments of Unicorn are
131 rare or even non-existent. There is NO WARRANTY whatsoever if anything
132 goes wrong, but let us know and we'll try our best to fix it.
134 Unicorn is designed to only serve fast clients either on the local host
135 or a fast LAN. See the PHILOSOPHY and DESIGN documents for more details
140 * WONTFIX: code reloading and restarts with Sinatra 0.3.x (and likely older
141 versions) apps is broken. The workaround is to force production
142 mode to disable code reloading as well as disabling "run" in your
144 set :env, :production
146 Since this is no longer an issue with Sinatra 0.9.x apps, this will not be
147 fixed on our end. Since Unicorn is itself the application launcher, the
148 at_exit handler used in old Sinatra always caused Mongrel to be launched
149 whenever a Unicorn worker was about to exit.
151 Also remember we're capable of replacing the running binary without dropping
152 any connections regardless of framework :)
156 All feedback (bug reports, user/development dicussion, patches, pull
157 requests) go to the mailing list/newsgroup. Patches must be sent inline
158 (git format-patch -M + git send-email). No subscription is necessary
159 to post on the mailing list. No top posting. Address replies +To:+ (or
160 +Cc:+) the original sender and +Cc:+ the mailing list.
162 * email: mongrel-unicorn@rubyforge.org
163 * nntp: nntp://news.gmane.org/gmane.comp.lang.ruby.unicorn.general
164 * archives: http://rubyforge.org/pipermail/mongrel-unicorn/
165 * subscribe: http://rubyforge.org/mailman/listinfo/mongrel-unicorn/