*epoll: refactor common loop code
[rainbows.git] / README
blob460fda90b000f483c2cb2c9c169fb48e31a74118
1 = Rainbows! - Unicorn for sleepy apps and slow clients
3 \Rainbows! is an HTTP server for sleepy Rack applications.  It is based on
4 Unicorn, but designed to handle applications that expect long
5 request/response times and/or slow clients.
7 For Rack applications not heavily bound by slow external network
8 dependencies, consider Unicorn instead as it simpler and easier to
9 debug.
11 If you're on a small system, or write extremely tight and reliable code
12 and don't want multiple worker processes, check out
13 {Zbatery}[http://zbatery.bogomip.org/], too. Zbatery can use all the
14 crazy network concurrency options of \Rainbows! in a single worker
15 process.
17 == \Rainbows! is about Diversity
19 We aim to support as many concurrency models as we can because they all
20 suck; differently.
22 For network concurrency, models we currently support are:
24 * {Coolio}[link:Rainbows/Coolio.html]
25 * {EventMachine}[link:Rainbows/EventMachine.html]
26 * {FiberSpawn}[link:Rainbows/FiberSpawn.html]
27 * {FiberPool}[link:Rainbows/FiberPool.html]
28 * {NeverBlock}[link:Rainbows/NeverBlock.html]
29 * {Revactor}[link:Rainbows/Revactor.html]
30 * {ThreadPool}[link:Rainbows/ThreadPool.html]
31 * {ThreadSpawn}[link:Rainbows/ThreadSpawn.html]
32 * {WriterThreadPool}[link:Rainbows/WriterThreadPool.html]
33 * {WriterThreadSpawn}[link:Rainbows/WriterThreadSpawn.html]
34 * {CoolioFiberSpawn}[link:Rainbows/CoolioFiberSpawn.html]
35 * {CoolioThreadPool}[link:Rainbows/CoolioThreadPool.html]
36 * {CoolioThreadSpawn}[link:Rainbows/CoolioThreadSpawn.html]
38 We have {many more on the way}[link:TODO.html] for handling network
39 concurrency.  Additionally, we also use multiple processes (managed by
40 Unicorn) for robustness and CPU/memory/disk concurrency.
42 We also provide Rainbows::AppPool Rack middleware for some network
43 concurrency models for limiting application concurrency independently of
44 network concurrency.
46 == Features
48 * Designed for {Rack}[http://rack.rubyforge.org/], the standard for
49   modern Ruby HTTP applications.
51 * Built on {Unicorn}[http://unicorn.bogomips.org/], inheriting its
52   process/socket management features such as transparent upgrades and
53   Ruby configuration DSL.
55 * As with Unicorn, it is able to stream large request bodies off the
56   socket to the application while the client is still uploading.  Since
57   \Rainbows! can handle slow clients, this feature is more useful than
58   it is with Unicorn.
60 * Combines heavyweight concurrency (worker processes) with lightweight
61   concurrency (Events/Fibers/Actors/Threads), allowing CPU/memory/disk to
62   be scaled independently of client connections.  More concurrency models
63   (listed in the TODO) will be supported as we find time for them.
65 * We give you {lots of options}[link:Summary.html] with more
66   {on the way}[link:TODO.html].
68 == Applications
70 \Rainbows! is mainly designed for the odd things Unicorn sucks at:
72 * 3rd-party APIs (to services outside your control/LAN)
73 * OpenID consumers (to providers outside your control/LAN)
74 * Reverse proxy implementations with editing/censoring
75   (to upstreams outside your control/LAN)
76 * Comet
77 * BOSH (with slow clients)
78 * HTTP server push
79 * Long polling
80 * Reverse AJAX
81 * real-time upload processing (via {upr}[http://upr.bogomips.org/])
83 \Rainbows! can also be used to service slow clients directly even with
84 fast applications.
86 == License
88 \Rainbows! is copyright 2009,2010 by all contributors (see logs in git).
89 It is based on Mongrel and Unicorn and carries the same license.
91 Mongrel is copyright 2007 Zed A. Shaw and contributors. It is licensed
92 under the Ruby license and the GPL2. See the included LICENSE file for
93 details.
95 \Rainbows! is 100% Free Software.
97 == Install
99 You may download the tarball from the \Rainbows! project page on Rubyforge
100 and run setup.rb after unpacking it:
102 http://rubyforge.org/frs/?group_id=8977
104 You may also install it via RubyGems on RubyGems.org:
106   gem install rainbows
108 == Usage
110 === for Rack applications
112 In APP_ROOT (where config.ru is located), run:
114   rainbows
116 \Rainbows! will bind to all interfaces on TCP port 8080 by default.
118 === Configuration File(s)
120 \Rainbows! will look for the config.ru file used by rackup in APP_ROOT.
122 For deployments, it can use a config file for Unicorn and
123 \Rainbows!-specific options specified by the +--config-file/-c+
124 command-line switch.  \Rainbows! accepts all options found in
125 {Unicorn::Configurator}[http://unicorn.bogomips.org/Unicorn/Configurator.html]
126 as well as the "\Rainbows!" block, so you can have the following in your
127 config file:
129     worker_processes 4 # assuming four CPU cores
130     Rainbows! do
131       use :FiberSpawn
132       worker_connections 100
133     end
135 See the {Rainbows! configuration}[link:Rainbows/Configurator.html]
136 {documentation}[link:Rainbows/Configurator.html]
137 for more details.
139 == Development
141 You can get the latest source via git from the following locations
142 (these versions may not be stable):
144   git://bogomips.org/rainbows.git
145   git://repo.or.cz/rainbows.git (mirror)
147 You may browse the code from the web and download the latest snapshot
148 tarballs here:
150 * http://bogomips.org/rainbows.git (cgit)
151 * http://repo.or.cz/w/rainbows.git (gitweb)
153 Inline patches (from "git format-patch") to the mailing list are
154 preferred because they allow code review and comments in the reply to
155 the patch.
157 We will adhere to mostly the same conventions for patch submissions as
158 git itself.  See the Documentation/SubmittingPatches document
159 distributed with git on on patch submission guidelines to follow.  Just
160 don't email the git mailing list or maintainer with \Rainbows! patches.
162 == Disclaimer
164 There is NO WARRANTY whatsoever if anything goes wrong, but let us know
165 and we'll try our best to fix it.
167 == Contact
169 All feedback (bug reports, user/development discussion, patches, pull
170 requests) go to the mailing list/newsgroup.  Patches must be sent inline
171 (git format-patch -M + git send-email).  No subscription is necessary
172 to post on the mailing list.  No top posting.  Address replies +To:+
173 the mailing list.
175 * email: mailto:rainbows-talk@rubyforge.org
176 * nntp: nntp://news.gmane.org/gmane.comp.lang.ruby.rainbows.general
177 * subscribe: http://rubyforge.org/mailman/listinfo/rainbows-talk
178 * archives: http://rubyforge.org/pipermail/rainbows-talk