rainbows.git  about / heads / tags
Unicorn for sleepy apps and slow clients
$ git log --pretty=format:'%h %s (%cs)%d'
cce6fa9 Rainbows! 5.2.1 (2020-01-29)
	(HEAD -> master, tag: v5.2.1)
828679d doc: replace pandoc-"Markdown" with real manpages (2020-01-26)
b9650fd doc: switch bogomips.org to yhbt.net (2020-01-09)
10055c1 doc: switch homepage to dark216 (2019-04-22)
1633be8 Rainbows! 5.2.0 (2019-01-05)
	(tag: v5.2.0)
270074a various documentation updates (2019-01-05)
1229fb8 t/test_isolate: various version updates (2019-01-02)
bbd10a0 t/hijack.ru: avoid shadow warning (2019-01-02)
229286b quiet mismatched indentation warnings (2019-01-02)
de313da Rainbows! 5.1.1 (2017-04-02)
	(tag: v5.1.1)

$ git cat-file blob HEAD:README
= Rainbows! - Rack app server for sleepy apps and slow clients

\Rainbows! is an HTTP server for sleepy Rack applications.  It is based on
unicorn, but designed to handle applications that expect long
request/response times and/or slow clients.

If you're on GNU/Linux and overwhelmed by options in \Rainbows!,
consider {yahns}[https://yhbt.net/yahns/] as it has fewer options
and more energy-efficient during non-peak traffic and may also
be configured as a single worker process.

For Rack applications not heavily bound by slow external network
dependencies, consider unicorn instead as it simpler and easier to

== \Rainbows! is about Diversity

We aim to support as many concurrency models as we can because they all
suck; differently.

For network concurrency, models we currently support are:

* {Coolio}[link:Rainbows/Coolio.html]
* {CoolioFiberSpawn}[link:Rainbows/CoolioFiberSpawn.html]
* {CoolioThreadPool}[link:Rainbows/CoolioThreadPool.html]
* {CoolioThreadSpawn}[link:Rainbows/CoolioThreadSpawn.html]
* {Epoll}[link:Rainbows/Epoll.html]
* {EventMachine}[link:Rainbows/EventMachine.html]
* {FiberPool}[link:Rainbows/FiberPool.html]
* {FiberSpawn}[link:Rainbows/FiberSpawn.html]
* {NeverBlock}[link:Rainbows/NeverBlock.html]
* {Revactor}[link:Rainbows/Revactor.html]
* {ThreadPool}[link:Rainbows/ThreadPool.html]
* {ThreadSpawn}[link:Rainbows/ThreadSpawn.html]
* {WriterThreadPool}[link:Rainbows/WriterThreadPool.html]
* {WriterThreadSpawn}[link:Rainbows/WriterThreadSpawn.html]
* {XEpoll}[link:Rainbows/XEpoll.html]
* {XEpollThreadPool}[link:Rainbows/XEpollThreadPool.html]
* {XEpollThreadSpawn}[link:Rainbows/XEpollThreadSpawn.html]

We have {many more on the way}[link:TODO.html] for handling network
concurrency.  Additionally, we also use multiple processes (managed by
Unicorn) for robustness and CPU/memory/disk concurrency.

We also provide Rainbows::AppPool Rack middleware for some network
concurrency models for limiting application concurrency independently of
network concurrency.

== Features

* Designed for {Rack}[http://rack.github.io/], the standard for
  modern Ruby HTTP applications.

* Built on {unicorn}[https://yhbt.net/unicorn/], inheriting its
  process/socket management features such as transparent upgrades and
  Ruby configuration DSL.

* As with Unicorn, it is able to stream large request bodies off the
  socket to the application while the client is still uploading.  Since
  \Rainbows! can handle slow clients, this feature is more useful than
  it is with Unicorn.

* Combines heavyweight concurrency (worker processes) with lightweight
  concurrency (Events/Fibers/Actors/Threads), allowing CPU/memory/disk to
  be scaled independently of client connections.  More concurrency models
  (listed in the TODO) will be supported as we find time for them.

* We give you {lots of options}[link:Summary.html] with more
  {on the way}[link:TODO.html].

== Applications

\Rainbows! is mainly designed for the odd things Unicorn sucks at:

* 3rd-party APIs (to services outside your control/LAN)
* OpenID consumers (to providers outside your control/LAN)
* Reverse proxy implementations with editing/censoring
  (to upstreams outside your control/LAN)
* Comet
* BOSH (with slow clients)
* HTTP server push
* Long polling
* Reverse AJAX

\Rainbows! can also be used to service slow clients directly even with
fast applications.

== License

\Rainbows! is copyright 2009,2010 by all contributors (see logs in git).
\Rainbows! is licensed under the Ruby (1.8) license or the GPLv2 or later.
See the included {LICENSE}[link:LICENSE.html] file for more details.

\Rainbows! is 100% Free Software.

== Install

You may install it via RubyGems on RubyGems.org:

  gem install rainbows

== Usage

=== for Rack applications

In APP_ROOT (where config.ru is located), run:


\Rainbows! will bind to all interfaces on TCP port 8080 by default.

=== Configuration File(s)

\Rainbows! will look for the config.ru file used by rackup in APP_ROOT.

For deployments, it can use a config file for Unicorn and
\Rainbows!-specific options specified by the +--config-file/-c+
command-line switch.  \Rainbows! accepts all options found in
as well as the "\Rainbows!" block, so you can have the following in your
config file:

    worker_processes 4 # assuming four CPU cores
    Rainbows! do
      use :ThreadSpawn
      worker_connections 100

See the {Rainbows! configuration}[link:Rainbows/Configurator.html]
for more details.

== Development

You can get the latest source via git from the following locations
(these versions may not be stable):

  https://repo.or.cz/rainbows.git (mirror)

You may browse the code from the web and download the latest snapshot
tarballs here:

* https://yhbt.net/rainbows.git
* https://repo.or.cz/rainbows.git (gitweb)

Inline patches (from "git format-patch") to the mailing list are
preferred because they allow code review and comments in the reply to
the patch.

We will adhere to mostly the same conventions for patch submissions as
git itself.  See the
document distributed with git on on patch submission guidelines to follow.
Just don't email the git mailing list or maintainer with \Rainbows! patches.

== Disclaimer

There is NO WARRANTY whatsoever if anything goes wrong, but let us know
and we'll try our best to fix it.

Rainbows! is extremely sensitive to fatal bugs in the apps it hosts.
Each Rainbows! worker process may be handling thousands of clients;
unexpectedly killing the process will abort _all_ of those
connections.  Lives may be lost!

Rainbows! hackers are not responsible for your application/library bugs.
Use an application server which is tolerant of buggy applications
if you cannot be bothered to fix all your fatal bugs.

== Contact

All feedback (bug reports, user/development discussion, patches, pull
requests) go to the mailing list.  Patches must be sent inline
(git format-patch -M + git send-email).  No subscription is necessary
to post on the mailing list.  No top posting.

* email: mailto:rainbows-public@yhbt.net
* subscribe: mailto:rainbows-public+subscribe@yhbt.net
* archives: https://yhbt.net/rainbows-public/

# heads (aka `branches'):
$ git for-each-ref --sort=-creatordate refs/heads \
	--format='%(HEAD) %(refname:short) %(subject) (%(creatordate:short))'
* master       Rainbows! 5.2.1 (2020-01-29)
  em-deferred  eventmachine: wait for deferred actions to finish (2017-01-09)

# tags:
$ git for-each-ref --sort=-creatordate refs/tags \
	--format='%(refname:short) %(subject) (%(creatordate:short))'
v5.2.1       Rainbows! 5.2.1 (2020-01-29) tar.gz
v5.2.0       Rainbows! 5.2.0 (2019-01-05) tar.gz
v5.1.1       Rainbows! 5.1.1 (2017-04-02) tar.gz
v5.1.0       Rainbows! 5.1.0 - rack 2.x compat, EM fixes (2017-01-12) tar.gz
v5.0.0       Rainbows! 5.0.0 - maintained as long as anybody uses it! (2015-11-25) tar.gz
v4.7.0       Rainbows! 4.7.0 - updates for ruby 2.3.0dev (2015-10-19) tar.gz
v4.6.2       Rainbows! 4.6.2 - see you on the other side (2014-05-12) tar.gz
v4.6.1       rainbows 4.6.1 - EventMachine fixes (2014-02-02) tar.gz
v4.6.0       Rainbows! 4.6.0 - fix unicorn 4.8.0 compatibility (2014-01-17) tar.gz
v4.5.0       Rainbows! 4.5.0 - hijacking support (2013-02-27) tar.gz

# associated public inboxes:
# (number on the left is used for dev purposes)

git clone https://yhbt.net/rainbows.git