http: add "HttpParser#keepalive?" method
[unicorn.git] / README
blob032f199990ac67771145de9900c4fd445a4ae2e8
1 = Unicorn: Rack HTTP server for Unix, fast clients and nothing else
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 or Rack.
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 * *Development branch* Decodes chunked transfers on-the-fly,
49   this allows upload progress notification to be implemented as well
50   as being able to tunnel arbitrary stream-based protocols over HTTP.
52 == Versions
54 {Stable v0.8.4}[http://git.bogomips.org/cgit/unicorn.git/tag/?id=v0.8.4]
56 {Development v0.9.2}[http://git.bogomips.org/cgit/unicorn.git/tag/?id=v0.9.2]
58 == License
60 Unicorn is copyright 2009 Eric Wong and contributors.
61 It is based on Mongrel and carries the same license:
63 Mongrel is copyright 2007 Zed A. Shaw and contributors. It is licensed
64 under the Ruby license and the GPL2. See the included LICENSE file for
65 details.
67 Unicorn is 100% Free Software.
69 == Install
71 The library consists of a C extension so you'll need a C compiler
72 and Ruby development libraries/headers.
74 You may download the tarball from the Mongrel project page on Rubyforge
75 and run setup.rb after unpacking it:
77 http://rubyforge.org/frs/?group_id=1306
79 You may also install it via Rubygems on Rubyforge:
81   gem install unicorn -v0.8.4
83 You can get the latest source via git from the following locations
84 (these versions may not be stable):
86   git://git.bogomips.org/unicorn.git
87   http://git.bogomips.org/unicorn.git
88   git://repo.or.cz/unicorn.git (mirror)
89   http://repo.or.cz/r/unicorn.git (mirror)
91 You may browse the code from the web and download the latest snapshot
92 tarballs here:
94 * http://git.bogomips.org/cgit/unicorn.git (cgit)
95 * http://repo.or.cz/w/unicorn.git (gitweb)
97 == Usage
99 === non-Rails Rack applications
101 In APP_ROOT, run:
103   unicorn
105 === for Rails applications (should work for all 1.2 or later versions)
107 In RAILS_ROOT, run:
109   unicorn_rails
111 Unicorn will bind to all interfaces on TCP port 8080 by default.
112 You may use the +--listen/-l+ switch to bind to a different
113 address:port or a UNIX socket.
115 === Configuration File(s)
117 Unicorn will look for the config.ru file used by rackup in APP_ROOT.
119 For deployments, it can use a config file for Unicorn-specific options
120 specified by the +--config-file/-c+ command-line switch.  See
121 Unicorn::Configurator for the syntax of the Unicorn-specific options.
122 The default settings are designed for maximum out-of-the-box
123 compatibility with existing applications.
125 Most command-line options for other Rack applications (above) are also
126 supported.  Run `unicorn -h` or `unicorn_rails -h` to see command-line
127 options.
129 == Disclaimer
131 Like the creatures themselves, production deployments of Unicorn are
132 rare or even non-existent.  There is NO WARRANTY whatsoever if anything
133 goes wrong, but let us know and we'll try our best to fix it.
135 Unicorn is designed to only serve fast clients either on the local host
136 or a fast LAN.  See the PHILOSOPHY and DESIGN documents for more details
137 regarding this.
139 == Known Issues
141 * WONTFIX: code reloading and restarts with Sinatra 0.3.x (and likely older
142   versions) apps is broken.  The workaround is to force production
143   mode to disable code reloading as well as disabling "run" in your
144   Sinatra application:
145     set :env, :production
146     set :run, false
147   Since this is no longer an issue with Sinatra 0.9.x apps, this will not be
148   fixed on our end.  Since Unicorn is itself the application launcher, the
149   at_exit handler used in old Sinatra always caused Mongrel to be launched
150   whenever a Unicorn worker was about to exit.
152   Also remember we're capable of replacing the running binary without dropping
153   any connections regardless of framework :)
155 == Contact
157 All feedback (bug reports, user/development dicussion, patches, pull
158 requests) go to the mailing list/newsgroup.  Patches must be sent inline
159 (git format-patch -M + git send-email).  No subscription is necessary
160 to post on the mailing list.  No top posting.  Address replies +To:+ (or
161 +Cc:+) the original sender and +Cc:+ the mailing list.
163 * email: mongrel-unicorn@rubyforge.org
164 * nntp: nntp://news.gmane.org/gmane.comp.lang.ruby.unicorn.general
165 * archives: http://rubyforge.org/pipermail/mongrel-unicorn/
166 * subscribe: http://rubyforge.org/mailman/listinfo/mongrel-unicorn/