unicorn 4.7.0 - minor updates, license tweak
[unicorn.git] / README
blob42167c8586dee5590e60f975baa82f439a5ca2d5
1 = Unicorn: Rack HTTP server for fast clients and Unix
3 \Unicorn is an HTTP server for Rack applications designed to only serve
4 fast clients on low-latency, high-bandwidth connections and take
5 advantage of features in Unix/Unix-like kernels.  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 == License
62 \Unicorn is copyright 2009 by all contributors (see logs in git).
63 It is based on Mongrel 1.1.5.
64 Mongrel is copyright 2007 Zed A. Shaw and contributors.
66 \Unicorn is licensed under (your choice) of the GPLv2 or later
67 (GPLv3+ preferred), or Ruby (1.8)-specific terms.
68 See the included LICENSE file for details.
70 \Unicorn is 100% Free Software.
72 == Install
74 The library consists of a C extension so you'll need a C compiler
75 and Ruby development libraries/headers.
77 You may download the tarball from the Mongrel project page on Rubyforge
78 and run setup.rb after unpacking it:
80 http://rubyforge.org/frs/?group_id=1306
82 You may also install it via RubyGems on RubyGems.org:
84   gem install unicorn
86 You can get the latest source via git from the following locations
87 (these versions may not be stable):
89   git://bogomips.org/unicorn.git
90   git://repo.or.cz/unicorn.git (mirror)
92 You may browse the code from the web and download the latest snapshot
93 tarballs here:
95 * http://bogomips.org/unicorn.git (cgit)
96 * http://repo.or.cz/w/unicorn.git (gitweb)
98 See the HACKING guide on how to contribute and build prerelease gems
99 from git.
101 == Usage
103 === non-Rails Rack applications
105 In APP_ROOT, run:
107   unicorn
109 === for Rails applications (should work for all 1.2 or later versions)
111 In RAILS_ROOT, run:
113   unicorn_rails
115 \Unicorn will bind to all interfaces on TCP port 8080 by default.
116 You may use the +--listen/-l+ switch to bind to a different
117 address:port or a UNIX socket.
119 === Configuration File(s)
121 \Unicorn will look for the config.ru file used by rackup in APP_ROOT.
123 For deployments, it can use a config file for \Unicorn-specific options
124 specified by the +--config-file/-c+ command-line switch.  See
125 Unicorn::Configurator for the syntax of the \Unicorn-specific options.
126 The default settings are designed for maximum out-of-the-box
127 compatibility with existing applications.
129 Most command-line options for other Rack applications (above) are also
130 supported.  Run `unicorn -h` or `unicorn_rails -h` to see command-line
131 options.
133 == Disclaimer
135 There is NO WARRANTY whatsoever if anything goes wrong, but
136 {let us know}[link:ISSUES.html] and we'll try our best to fix it.
138 \Unicorn is designed to only serve fast clients either on the local host
139 or a fast LAN.  See the PHILOSOPHY and DESIGN documents for more details
140 regarding this.
142 == Contact
144 All feedback (bug reports, user/development dicussion, patches, pull
145 requests) go to the mailing list/newsgroup.  See the ISSUES document for
146 information on the {mailing list}[mailto:mongrel-unicorn@rubyforge.org].
148 For the latest on \Unicorn releases, you may also finger us at
149 unicorn@bogomips.org or check our NEWS page (and subscribe to our Atom
150 feed).