rainbows slower?

Eric Wong normalperson at yhbt.net
Fri Jun 8 23:31:31 UTC 2012

Eric Wong <normalperson at yhbt.net> wrote:
> What is your RACK_ENV set to?  I'm not sure how Thin sets it or defaults
> to, but you can pass the "-E" switch to Rainbows!:
>   rainbows -E none ...
> (or use the RACK_ENV environment variable)

I suspect it's RACK_ENV being "development" by default and slowing
things down heavily (Rack::Lint).  I wasn't able to reproduce the
drastic differences between thin and Rainbows with RACK_ENV=none on
Rack::Lobster.  Not a real app I know, but in the absence of a real one,
it's all I've got.

I used the following config.ru
require "rack/lobster"
use Rack::ContentLength
use Rack::ContentType
run Rack::Lobster.new

and my rainbows.conf.rb
worker_processes 2 # only 2 cores on this machine, I also tried with 1
Rainbows! do
  use :EventMachine
  worker_connections 1024

thin 1.3.1
rainbows 4.3.1
rack 1.4.1
Ruby 1.9.3-p194
Linux 3.4.1 on x86-64

Commands used:
	ab -n 1000 -c 100 -k
	RACK_ENV=none thin start -R config.ru
	RACK_ENV=none rainbows -c rainbows.conf.rb config.ru -p 3000

I tested without keepalives (-k), too but again, it's too close
to say one server is faster than another based on Rack::Lobster.
For "hello world"-type apps, Rainbows! will use worker_processes
more effectively with keepalives.

More information about the rainbows-talk mailing list