quiet some mismatched indentation warnings
[unicorn.git] / README
blob29e04b4853a65f4452a667d33b8ad0db737e8260
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.org/] or {Rack}[http://rack.github.io/].
15 * Compatible with Ruby 1.9.3 and later.
16   unicorn 4.x remains supported for Ruby 1.8 users.
18 * Process management: unicorn will reap and restart workers that
19   die from broken apps.  There is no need to manage multiple processes
20   or ports yourself.  unicorn can spawn and manage any number of
21   worker processes you choose to scale to your backend.
23 * Load balancing is done entirely by the operating system kernel.
24   Requests never pile up behind a busy worker process.
26 * Does not care if your application is thread-safe or not, workers
27   all run within their own isolated address space and only serve one
28   client at a time for maximum robustness.
30 * Builtin reopening of all log files in your application via
31   USR1 signal.  This allows logrotate to rotate files atomically and
32   quickly via rename instead of the racy and slow copytruncate method.
33   unicorn also takes steps to ensure multi-line log entries from one
34   request all stay within the same file.
36 * nginx-style binary upgrades without losing connections.
37   You can upgrade unicorn, your entire application, libraries
38   and even your Ruby interpreter without dropping clients.
40 * before_fork and after_fork hooks in case your application
41   has special needs when dealing with forked processes.  These
42   should not be needed when the "preload_app" directive is
43   false (the default).
45 * Can be used with copy-on-write-friendly memory management
46   to save memory (by setting "preload_app" to true).
48 * Able to listen on multiple interfaces including UNIX sockets,
49   each worker process can also bind to a private port via the
50   after_fork hook for easy debugging.
52 * Simple and easy Ruby DSL for configuration.
54 * Decodes chunked requests on-the-fly.
56 == License
58 unicorn is copyright 2009-2016 by all contributors (see logs in git).
59 It is based on Mongrel 1.1.5.
60 Mongrel is copyright 2007 Zed A. Shaw and contributors.
62 unicorn is licensed under (your choice) of the GPLv2 or later
63 (GPLv3+ preferred), or Ruby (1.8)-specific terms.
64 See the included LICENSE file for details.
66 unicorn is 100% Free Software (including all development tools used).
68 == Install
70 The library consists of a C extension so you'll need a C compiler
71 and Ruby development libraries/headers.
73 You may install it via RubyGems on RubyGems.org:
75   gem install unicorn
77 You can get the latest source via git from the following locations
78 (these versions may not be stable):
80   git://bogomips.org/unicorn.git
81   git://repo.or.cz/unicorn.git (mirror)
83 You may browse the code from the web:
85 * https://bogomips.org/unicorn.git
86 * http://repo.or.cz/w/unicorn.git (gitweb)
88 See the HACKING guide on how to contribute and build prerelease gems
89 from git.
91 == Usage
93 === Rack (including Rails 3+) applications
95 In APP_ROOT, run:
97   unicorn
99 unicorn will bind to all interfaces on TCP port 8080 by default.
100 You may use the +--listen/-l+ switch to bind to a different
101 address:port or a UNIX socket.
103 === Configuration File(s)
105 unicorn will look for the config.ru file used by rackup in APP_ROOT.
107 For deployments, it can use a config file for unicorn-specific options
108 specified by the +--config-file/-c+ command-line switch.  See
109 Unicorn::Configurator for the syntax of the unicorn-specific options.
110 The default settings are designed for maximum out-of-the-box
111 compatibility with existing applications.
113 Most command-line options for other Rack applications (above) are also
114 supported.  Run `unicorn -h` to see command-line options.
116 == Disclaimer
118 There is NO WARRANTY whatsoever if anything goes wrong, but
119 {let us know}[link:ISSUES.html] and we'll try our best to fix it.
121 unicorn is designed to only serve fast clients either on the local host
122 or a fast LAN.  See the PHILOSOPHY and DESIGN documents for more details
123 regarding this.
125 == Contact
127 All feedback (bug reports, user/development dicussion, patches, pull
128 requests) go to the mailing list/newsgroup.  See the ISSUES document for
129 information on the {mailing list}[mailto:unicorn-public@bogomips.org].
131 The mailing list is archived at https://bogomips.org/unicorn-public/
132 Read-only NNTP access is available at:
133 nntp://news.public-inbox.org/inbox.comp.lang.ruby.unicorn and
134 nntp://news.gmane.org/gmane.comp.lang.ruby.unicorn.general
136 For the latest on unicorn releases, you may also finger us at
137 unicorn@bogomips.org or check our NEWS page (and subscribe to our Atom
138 feed).