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