README/gemspec: a better description, hopefully
[unicorn.git] / README
bloba6a7be1107ac3dd1fbc1aea1d68bb96403c8e3d0
1 = Unicorn: Rack HTTP server for Unix and fast clients
3 Unicorn is a HTTP server for Rack applications designed to take
4 advantage of features in Unix/Unix-like kernels and only serve fast
5 clients on low-latency, high-bandwidth connections.  Slow clients should
6 only be served by placing a reverse proxy capable of fully-buffering
7 both the the request and response in between Unicorn and slow clients.
9 == Features
11 * Designed for Rack, Unix, fast clients, and ease-of-debugging.  We
12   cut out everything that is better supported by the operating system,
13   {nginx}[http://nginx.net/] or {Rack}[http://rack.rubyforge.org/].
15 * Compatible with both Ruby 1.8 and 1.9.  Rubinius support is in-progress.
17 * Process management: Unicorn will reap and restart workers that
18   die from broken apps.  There is no need to manage multiple processes
19   or ports yourself.  Unicorn can spawn and manage any number of
20   worker processes you choose to scale to your backend.
22 * Load balancing is done entirely by the operating system kernel.
23   Requests never pile up behind a busy worker process.
25 * Does not care if your application is thread-safe or not, workers
26   all run within their own isolated address space and only serve one
27   client at a time for maximum robustness.
29 * Supports all Rack applications, along with pre-Rack versions of
30   Ruby on Rails via a Rack wrapper.
32 * Builtin reopening of all log files in your application via
33   USR1 signal.  This allows logrotate to rotate files atomically and
34   quickly via rename instead of the racy and slow copytruncate method.
35   Unicorn also takes steps to ensure multi-line log entries from one
36   request all stay within the same file.
38 * nginx-style binary upgrades without losing connections.
39   You can upgrade Unicorn, your entire application, libraries
40   and even your Ruby interpreter without dropping clients.
42 * before_fork and after_fork hooks in case your application
43   has special needs when dealing with forked processes.  These
44   should not be needed when the "preload_app" directive is
45   false (the default).
47 * Can be used with copy-on-write-friendly memory management
48   to save memory (by setting "preload_app" to true).
50 * Able to listen on multiple interfaces including UNIX sockets,
51   each worker process can also bind to a private port via the
52   after_fork hook for easy debugging.
54 * Simple and easy Ruby DSL for configuration.
56 * Decodes chunked transfers on-the-fly, thus allowing upload progress
57   notification to be implemented as well as being able to tunnel
58   arbitrary stream-based protocols over HTTP.
60 == Versions
62 {Current v0.92.0}[http://git.bogomips.org/cgit/unicorn.git/tag/?id=v0.92.0]
64 {Old Stable v0.8.4}[http://git.bogomips.org/cgit/unicorn.git/tag/?id=v0.8.4]
66 == License
68 Unicorn is copyright 2009 Eric Wong and contributors.
69 It is based on Mongrel and carries the same license.
71 Mongrel is copyright 2007 Zed A. Shaw and contributors. It is licensed
72 under the Ruby license and the GPL2. See the included LICENSE file for
73 details.
75 Unicorn is 100% Free Software.
77 == Install
79 The library consists of a C extension so you'll need a C compiler
80 and Ruby development libraries/headers.
82 You may download the tarball from the Mongrel project page on Rubyforge
83 and run setup.rb after unpacking it:
85 http://rubyforge.org/frs/?group_id=1306
87 You may also install it via Rubygems on Rubyforge:
89   gem install unicorn
91 You can get the latest source via git from the following locations
92 (these versions may not be stable):
94   git://git.bogomips.org/unicorn.git
95   http://git.bogomips.org/unicorn.git
96   git://repo.or.cz/unicorn.git (mirror)
97   http://repo.or.cz/r/unicorn.git (mirror)
99 You may browse the code from the web and download the latest snapshot
100 tarballs here:
102 * http://git.bogomips.org/cgit/unicorn.git (cgit)
103 * http://repo.or.cz/w/unicorn.git (gitweb)
105 == Usage
107 === non-Rails Rack applications
109 In APP_ROOT, run:
111   unicorn
113 === for Rails applications (should work for all 1.2 or later versions)
115 In RAILS_ROOT, run:
117   unicorn_rails
119 Unicorn will bind to all interfaces on TCP port 8080 by default.
120 You may use the +--listen/-l+ switch to bind to a different
121 address:port or a UNIX socket.
123 === Configuration File(s)
125 Unicorn will look for the config.ru file used by rackup in APP_ROOT.
127 For deployments, it can use a config file for Unicorn-specific options
128 specified by the +--config-file/-c+ command-line switch.  See
129 Unicorn::Configurator for the syntax of the Unicorn-specific options.
130 The default settings are designed for maximum out-of-the-box
131 compatibility with existing applications.
133 Most command-line options for other Rack applications (above) are also
134 supported.  Run `unicorn -h` or `unicorn_rails -h` to see command-line
135 options.
137 == Disclaimer
139 Like the creatures themselves, production deployments of Unicorn are
140 rare or even non-existent.  There is NO WARRANTY whatsoever if anything
141 goes wrong, but let us know and we'll try our best to fix it.
143 Unicorn is designed to only serve fast clients either on the local host
144 or a fast LAN.  See the PHILOSOPHY and DESIGN documents for more details
145 regarding this.
147 == Known Issues
149 * WONTFIX: code reloading and restarts with Sinatra 0.3.x (and likely older
150   versions) apps is broken.  The workaround is to force production
151   mode to disable code reloading as well as disabling "run" in your
152   Sinatra application:
153     set :env, :production
154     set :run, false
155   Since this is no longer an issue with Sinatra 0.9.x apps, this will not be
156   fixed on our end.  Since Unicorn is itself the application launcher, the
157   at_exit handler used in old Sinatra always caused Mongrel to be launched
158   whenever a Unicorn worker was about to exit.
160   Also remember we're capable of replacing the running binary without dropping
161   any connections regardless of framework :)
163 == Contact
165 All feedback (bug reports, user/development dicussion, patches, pull
166 requests) go to the mailing list/newsgroup.  Patches must be sent inline
167 (git format-patch -M + git send-email).  No subscription is necessary
168 to post on the mailing list.  No top posting.  Address replies +To:+ (or
169 +Cc:+) the original sender and +Cc:+ the mailing list.
171 * email: mailto:mongrel-unicorn@rubyforge.org
172 * nntp: nntp://news.gmane.org/gmane.comp.lang.ruby.unicorn.general
173 * archives: http://rubyforge.org/pipermail/mongrel-unicorn/
174 * subscribe: http://rubyforge.org/mailman/listinfo/mongrel-unicorn/
175 * finger: unicorn@bogomips.org