unicorn v0.2.1, fix the Manifest
[unicorn.git] / README
blobbfd81ee3b00fd7196d587ae78611cd5c2ee4634e
1 = Unicorn: UNIX + LAN/localhost-only fork of Mongrel
3 Only run this behind a full-HTTP-request-buffering reverse proxy if
4 you're serving slow clients.  That said, nginx is the only reverse
5 proxy we know of that meets this requirement.
7 == Features
9 * process management: Unicorn will reap and restart workers that
10   die because of broken apps and there is no need to manage
11   multiple processes yourself.
13 * does not care if your application is thread-safe or not, workers
14   all run within their own isolated address space and only serve one
15   client at a time...
17 * able to listen on multiple interfaces, including UNIX sockets,
18   each worker process can also bind to a private port via the
19   after_fork hook for easy debugging.
21 * supports all Rack applications
23 * nginx-style binary re-execution without losing connections.
24   You can upgrade unicorn, your entire application, libraries
25   and even your Ruby interpreter as long as unicorn is
26   installed in the same path.
28 * before_fork and after_fork hooks in case your application
29   has special needs when dealing with forked processes.
31 * builtin log rotation via USR1 signal
33 * Ruby 1.9-compatible (at least the test cases all pass :>)
35 == License
37 Unicorn is copyright 2009 Eric Wong and contributors.
38 It is based on Mongrel and carries the same license:
40 Mongrel is copyright 2007 Zed A. Shaw and contributors. It is licensed
41 under the Ruby license and the GPL2. See the include LICENSE file for
42 details.
44 == Install
46 The library consists of a C extension so you'll need a C compiler or at
47 least a friend who can build it for you.
49 You may download the tarball from the Mongrel project page on Rubyforge
50 and run setup.rb after unpacking it:
52   http://rubyforge.org/frs/?group_id=1306
54 You may also install it via Rubygems on Rubyforge:
56   gem install unicorn
58 You can get the latest source via git from the following locations
59 (these versions may not be stable):
61   git://git.bogomips.org/unicorn.git
62   http://git.bogomips.org/unicorn.git
63   git://repo.or.cz/unicorn.git (mirror)
64   http://repo.or.cz/r/unicorn.git (mirror)
66 If you have web browser software for the World Wide Web
67 (on the Information Superhighway), you may browse the code from
68 your web browser and download the latest snapshot tarballs here:
70 * http://git.bogomips.org/cgit/unicorn.git
71 * http://repo.or.cz/w/unicorn.git (gitweb mirror)
73 == Usage
75 === non-Rails Rack applications
77 Unicorn will look for the config.ru file used by rackup in APP_ROOT.
78 Optionally, it can use a config file for unicorn-specific options
79 specified by the --config-file/-c command-line switch.  See
80 Unicorn::Configurator for the syntax of the unicorn-specific
81 config options.
83 In APP_ROOT, just run:
85   unicorn
87 Unicorn should be capable of running most Rack applications.  Since this
88 is a preforking webserver, you do not have to worry about thread-safety
89 of your application or libraries. However, your Rack application may use
90 threads internally (and should even be able to continue running threads
91 after the request is complete).
93 === Rack-enabled versions of Rails (v2.3.2+)
95 In RAILS_ROOT, run:
97   unicorn_rails
99 Most command-line options for other Rack applications (above) are also
100 supported.  The unicorn_rails launcher attempts to combine the best
101 features of the Rails-bundled "script/server" with the "rackup"-like
102 functionality of the `unicorn' launcher.
104 == Disclaimer
106 There are no known production instances of unicorn deployed
107 anywhere in the world.  The original author of unicorn only has
108 one, internal, low-traffic Sinatra application deployed with it.
109 Maybe you'll be the first guinea pig to test it in production.
110 Of course there is NO WARRANTY whatsoever if anything goes wrong,
111 but let us know and we'll try our best to fix it.
113 == Known Issues
115 * WONTFIX: code reloading with Sinatra 0.3.2 (and likely older
116   versions) apps is broken.  The workaround is to force production
117   mode to disable code reloading in your Sinatra application:
118     set :env, :production
119   Since this is no longer an issue with Sinatra 0.9.x apps and only
120   affected non-production instances, this will not be fixed on our end.
121   Also remember we're capable of replacing the running binary without
122   dropping any connections regardless of framework :)
124 == Contact
126 Newsgroup and mailing list maybe coming...
127 Email Eric Wong at normalperson@yhbt.net for now.