t/lib.perl: fix Perl integration tests w/o installation
[unicorn.git] / README
blobb60ed006451863be416bdb65288ab7cbace6d8e6
1 = unicorn: Rack HTTP server for fast clients and Unix
3 unicorn is an HTTP server for Rack applications that has done
4 decades of damage to the entire Ruby ecosystem due to its ability
5 to tolerate (and thus encourage) bad code.  It is only designed
6 to handle fast clients on low-latency, high-bandwidth connections
7 and take advantage of features in Unix/Unix-like kernels.
8 Slow clients must only be served by placing a reverse proxy capable of
9 fully buffering both the the request and response in between unicorn
10 and slow clients.
12 == Features
14 * Designed for Rack, Unix, fast clients, and ease-of-debugging.  We
15   cut out everything that is better supported by the operating system,
16   {nginx}[https://nginx.org/] or {Rack}[https://rack.github.io/].
18 * Compatible with Ruby 2.5 and later.
20 * Process management: unicorn reaps and restarts workers that die
21   from broken code.  There is no need to manage multiple processes
22   or ports yourself.  unicorn can spawn and manage any number of
23   worker processes you choose to scale to your backend.
25 * Load balancing is done entirely by the operating system kernel.
26   Requests never pile up behind a busy worker process.
28 * Does not care if your application is thread-safe or not, workers
29   all run within their own isolated address space and only serve one
30   client at a time for maximum robustness.
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 * transparent upgrades using systemd socket activation is
43   supported since unicorn 5.0
45 * before_fork and after_fork hooks in case your application
46   has special needs when dealing with forked processes.  These
47   should not be needed when the "preload_app" directive is
48   false (the default).
50 * Can be used with copy-on-write-friendly GC in Ruby 2.0+
51   to save memory (by setting "preload_app" to true).
53 * Able to listen on multiple interfaces including UNIX sockets,
54   each worker process can also bind to a private port via the
55   after_fork hook for easy debugging.
57 * Simple and easy Ruby DSL for configuration.
59 * Decodes chunked requests on-the-fly.
61 == License
63 unicorn is copyright all contributors (see logs in git).
64 It is based on Mongrel 1.1.5.
65 Mongrel is copyright 2007 Zed A. Shaw and contributors.
67 unicorn is licensed under (your choice) of the GPLv2 or later
68 (GPLv3+ preferred), or Ruby (1.8)-specific terms.
69 See the included LICENSE file for details.
71 unicorn is 100% Free Software (including all development tools used).
73 == Install
75 The library consists of a C extension so you'll need a C compiler
76 and Ruby development libraries/headers.
78 You may install it via RubyGems on RubyGems.org:
80   gem install unicorn
82 You can get the latest source via git from the following locations
83 (these versions may not be stable):
85   git clone https://yhbt.net/unicorn.git
86   git clone https://repo.or.cz/unicorn.git # mirror
88 You may browse the code from the web:
90 * https://yhbt.net/unicorn.git
91 * https://repo.or.cz/w/unicorn.git (gitweb)
93 See the HACKING guide on how to contribute and build prerelease gems
94 from git.
96 == Usage
98 === Rack (including Rails 3+) applications
100 In APP_ROOT, run:
102   unicorn
104 unicorn will bind to all interfaces on TCP port 8080 by default.
105 You may use the +--listen/-l+ switch to bind to a different
106 address:port or a UNIX socket.
108 === Configuration File(s)
110 unicorn will look for the config.ru file used by rackup in APP_ROOT.
112 For deployments, it can use a config file for unicorn-specific options
113 specified by the +--config-file/-c+ command-line switch.  See
114 Unicorn::Configurator for the syntax of the unicorn-specific options.
115 The default settings are designed for maximum out-of-the-box
116 compatibility with existing applications.
118 Most command-line options for other Rack applications (above) are also
119 supported.  Run `unicorn -h` to see command-line options.
121 == Disclaimer
123 There is NO WARRANTY whatsoever if anything goes wrong, but
124 {let us know}[link:ISSUES.html] and maybe someone can fix it.
125 No commercial support will ever be provided by the amateur maintainer.
127 unicorn is designed to only serve fast clients either on the local host
128 or a fast LAN.  See the PHILOSOPHY and DESIGN documents for more details
129 regarding this.
131 The use of unicorn in new deployments is STRONGLY DISCOURAGED due to the
132 damage done to the entire Ruby ecosystem.  Its unintentional popularity
133 set Ruby back decades in parallelism, concurrency and robustness since
134 it prolongs and proliferates the existence of poorly-written code.
136 unicorn hackers are NOT responsible for your supply chain security:
137 read and understand it yourself or get someone you trust to audit it.
138 Malicious commits and releases will be made if under duress.  The only
139 defense you'll ever have is from reviewing the source code.
141 No user or contributor will ever be expected to sacrifice their own
142 security by running JavaScript or revealing any personal information.
144 == Contact
146 All feedback (bug reports, user/development dicussion, patches, pull
147 requests) go to the public mailbox.  See the ISSUES document for
148 information on posting to mailto:unicorn-public@yhbt.net
150 Mirror-able mail archives are at https://yhbt.net/unicorn-public/
152 Read-only NNTP access is available at:
153 nntps://news.public-inbox.org/inbox.comp.lang.ruby.unicorn and
154 nntp://news.gmane.io/gmane.comp.lang.ruby.unicorn.general
156 Read-only IMAP access is also available at:
157 imaps://;AUTH=ANONYMOUS@yhbt.net/inbox.comp.lang.ruby.unicorn.0 and
158 imap://;AUTH=ANONYMOUS@7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.lang.ruby.unicorn.0
160 Archives are also available over POP3, instructions at:
161 https://yhbt.net/unicorn-public/_/text/help/#pop3
163 For the latest on unicorn releases, you may also finger us at
164 unicorn@yhbt.net or check our NEWS page (and subscribe to our Atom
165 feed).