GNUmakefile: "install" preserves unicorn_rails
[unicorn.git] / README
blob4c7d1abda9850bfbb7e80a6356bacf61314bc96b
1 = Unicorn: Unix + LAN/localhost-optimized fork of Mongrel
3 Unicorn is designed to only serve fast clients.  See the PHILOSOPHY
4 and DESIGN documents for more details regarding this.
6 == Features
8 * Built on the solid Mongrel code base and takes full advantage
9   of functionality exclusive to Unix-like operating systems.
11 * Mostly written in Ruby, only the HTTP parser (stolen and trimmed
12   down from Mongrel) is written in C.  Unicorn is compatible with
13   both Ruby 1.8 and 1.9.
15 * Process management: Unicorn will reap and restart workers that
16   die from broken apps.  There is no need to manage multiple processes
17   yourself.
19 * Load balancing is done entirely by the operating system kernel.
20   Requests never pile up behind a busy worker.
22 * Does not care if your application is thread-safe or not, workers
23   all run within their own isolated address space and only serve one
24   client at a time...
26 * Supports all Rack applications, along with pre-Rack versions of
27   Ruby on Rails via a Rack wrapper.
29 * Builtin log rotation of all log files in your application via USR1
30   signal.
32 * nginx-style binary re-execution without losing connections.
33   You can upgrade Unicorn, your entire application, libraries
34   and even your Ruby interpreter as long as Unicorn is
35   installed in the same path.
37 * before_fork and after_fork hooks in case your application
38   has special needs when dealing with forked processes.
40 * Can be used with copy-on-write-friendly memory management
41   to save memory.
43 * Able to listen on multiple interfaces including UNIX sockets,
44   each worker process can also bind to a private port via the
45   after_fork hook for easy debugging.
47 == License
49 Unicorn is copyright 2009 Eric Wong and contributors.
50 It is based on Mongrel and carries the same license:
52 Mongrel is copyright 2007 Zed A. Shaw and contributors. It is licensed
53 under the Ruby license and the GPL2. See the include LICENSE file for
54 details.
56 Unicorn is 100% Free Software.
58 == Install
60 The library consists of a C extension so you'll need a C compiler or at
61 least a friend who can build it for you.
63 You may download the tarball from the Mongrel project page on Rubyforge
64 and run setup.rb after unpacking it:
66 http://rubyforge.org/frs/?group_id=1306
68 You may also install it via Rubygems on Rubyforge:
70   gem install unicorn
72 You can get the latest source via git from the following locations
73 (these versions may not be stable):
75   git://git.bogomips.org/unicorn.git
76   http://git.bogomips.org/unicorn.git
77   git://repo.or.cz/unicorn.git (mirror)
78   http://repo.or.cz/r/unicorn.git (mirror)
80 If you have web browser software for the World Wide Web
81 (on the Information Superhighway), you may browse the code from
82 your web browser and download the latest snapshot tarballs here:
84 * http://git.bogomips.org/cgit/unicorn.git (this server runs Unicorn!)
85 * http://repo.or.cz/w/unicorn.git (gitweb mirror)
87 == Usage
89 === non-Rails Rack applications
91 In APP_ROOT, run:
93   unicorn
95 === for Rails applications (should work for all 1.2 or later versions)
97 In RAILS_ROOT, run:
99   unicorn_rails
101 Unicorn will bind to all interfaces TCP port 8080 by default.
102 You may use the '-l/--listen' switch to bind to a different
103 address:port or a UNIX socket.
105 === Configuration File(s)
107 Unicorn will look for the config.ru file used by rackup in APP_ROOT.
109 For deployments, it can use a config file for Unicorn-specific options
110 specified by the --config-file/-c command-line switch.  See
111 Unicorn::Configurator for the syntax of the Unicorn-specific options.
112 The default settings are designed for maximum out-of-the-box
113 compatibility with existing applications.
115 Most command-line options for other Rack applications (above) are also
116 supported.  Run `unicorn -h` or `unicorn_rails -h` to see command-line
117 options.
119 == Disclaimer
121 Like the creatures themselves, production deployments of Unicorn are rare.
122 There is NO WARRANTY whatsoever if anything goes wrong, but let us know and
123 we'll try our best to fix it.
125 Rainbows are NOT included.
127 == Known Issues
129 * WONTFIX: code reloading with Sinatra 0.3.2 (and likely older
130   versions) apps is broken.  The workaround is to force production
131   mode to disable code reloading in your Sinatra application:
132     set :env, :production
133   Since this is no longer an issue with Sinatra 0.9.x apps and only
134   affected non-production instances, this will not be fixed on our end.
135   Also remember we're capable of replacing the running binary without
136   dropping any connections regardless of framework :)
138 == Contact
140 Newsgroup and mailing list maybe coming...
141 Email Eric Wong at normalperson@yhbt.net for now.