= Rainbows! Unicorn for sleepy apps and slow clients Rainbows! is a 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. For Rack applications not heavily bound by slow external network dependencies, consider Unicorn instead as it simpler and easier to debug. == \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: * {:ThreadSpawn}[link:Rainbows/ThreadSpawn.html] * {:ThreadPool}[link:Rainbows/ThreadPool.html] * {:Revactor}[link:Rainbows/Revactor.html] * {:Rev}[link:Rainbows/Rev.html]* We have {more on the way}[link:TODO.html] for handling network concurrency. Additionally, we also use multiple processes (managed by Unicorn) for CPU/memory/disk concurrency. \* our \Rev concurrency model is only recommended for slow clients, not sleepy apps. Additionally it does not support streaming "rack.input" to the application. For application concurrency, we have the Rainbows::AppPool Rack middleware that allows us to limit application concurrency independently of network concurrency. Rack::Lock as distributed by Rack may also be used to limit application concurrency to one (per-worker). == Features * Designed for {Rack}[http://rack.rubyforge.org/], the standard for modern Ruby HTTP applications. * Built on {Unicorn}[http://unicorn.bogomips.org/], 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 (Actors or Threads), allowing CPU/memory/disk to be scaled independently of client connections. Alternative concurrency models (listed in the TODO) will be supported as we find time for them. == Applications \Rainbows is 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 may also be used to service slow clients even with fast applications using the \Rev concurrency model. == License \Rainbows! is copyright 2009 by all contributors (see logs in git). It is based on Mongrel and Unicorn and carries the same license. Mongrel is copyright 2007 Zed A. Shaw and contributors. It is licensed under the Ruby license and the GPL2. See the included LICENSE file for details. \Rainbows! is 100% Free Software. == Install You may download the tarball from the Rainbows project page on Rubyforge and run setup.rb after unpacking it: http://rubyforge.org/frs/?group_id=8977 You may also install it via Rubygems on Rubyforge: gem install rainbows == Usage === for Rack applications In APP_ROOT (where config.ru is located), run: rainbows \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 {Unicorn::Configurator}[http://unicorn.bogomips.org/Unicorn/Configurator.html] as well as the "\Rainbows!" block, so you can have the following in your config file: Rainbows! do use :Revactor worker_connections 400 end See the {Rainbows! configuration documentation}[link:Rainbows.html#M000001] for more details. == Development You can get the latest source via git from the following locations (these versions may not be stable): git://git.bogomips.org/rainbows.git git://rubyforge.org/rainbows.git (mirror) You may browse the code from the web and download the latest snapshot tarballs here: * http://git.bogomips.org/cgit/rainbows.git (cgit) * http://rainbows.rubyforge.org/git?p=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 Documentation/SubmittingPatches 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. == Contact All feedback (bug reports, user/development dicussion, patches, pull requests) go to the mailing list/newsgroup. 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. Address replies +To:+ the mailing list. * email: mailto:rainbows-talk@rubyforge.org * nntp: nntp://news.gmane.org/gmane.comp.lang.ruby.rainbows.general * subscribe: http://rubyforge.org/mailman/listinfo/rainbows-talk * archives: http://rubyforge.org/pipermail/rainbows-talk