rainbows slower?

Joseph McDonald superjoe at gmail.com
Fri Jun 8 16:04:48 UTC 2012


I have a "hello world" sinatra app, benchmark:
ab -n 1000 -c 100 http://$mysite/

Total transferred:      264000 bytes
HTML transferred:       13000 bytes
Requests per second:    308.76 [#/sec] (mean)
Time per request:       323.871 [ms] (mean)
Time per request:       3.239 [ms] (mean, across all concurrent requests)

If I put rainbows in front of it, I get:

Total transferred:      272000 bytes
HTML transferred:       13000 bytes
Requests per second:    61.62 [#/sec] (mean)
Time per request:       1622.745 [ms] (mean)
Time per request:       16.227 [ms] (mean, across all concurrent requests)

rainbow config looks like:

worker_processes 7  # i'm on an 8 core system
Rainbows! do
  use :EventMachine   # sinatra app using "thin"
  worker_connections 1024

config.ru looks like:
require './webserver'
run Sinatra::Application

ruby version is: ruby 1.9.3p194

I tried telling apachebench to use keepalives (-k) and that slowed
rainbows down more (and sped up the straight sinatra app).
I have changed worker_processes and worker_connections with no effect.
 I added keepalive_timeout 0 to the Rainbows! block with no effect.

any idea why rainbows is slower?  I'd like to take advantage of all my cores.


More information about the rainbows-talk mailing list