From: Eric Wong <normalperson-rMlxZR9MS24@public.gmane.org>
To: Rainbows! list <rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org>
Subject: Re: rainbows slower?
Date: Fri, 8 Jun 2012 17:39:20 +0000 [thread overview]
Message-ID: <20120608173920.GA20100@dcvr.yhbt.net> (raw)
In-Reply-To: <CAKN4AWvqRyxTMOVNjc5bGzrkOKGZJ6TsTwBuYu_ZekXaeqT9ag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
Joseph McDonald <superjoe-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:
> Hi,
>
> 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
> end
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)
Iff you're on Linux, and RACK_ENV doesn't help, can you try:
listen host_port, :tcp_defer_accept => false
I still need to investigate what (I think) is a bug in Linux which
makes TCP_DEFER_ACCEPT behave erratically.
> config.ru looks like:
> require './webserver'
> run Sinatra::Application
Can you show us your 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.
Can you also verify your app is setting Content-Length (or
Transfer-Encoding: chunked) in its responses?
> any idea why rainbows is slower? I'd like to take advantage of all my
> cores.
I've listed what I can think of above. Thanks for giving Rainbows!
a short. I'd like to figure out why performance is worse, too.
_______________________________________________
Rainbows! mailing list - rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org
http://rubyforge.org/mailman/listinfo/rainbows-talk
Do not quote signatures (like this one) or top post when replying
next prev parent reply other threads:[~2012-06-08 17:40 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-08 16:04 rainbows slower? Joseph McDonald
[not found] ` <CAKN4AWvqRyxTMOVNjc5bGzrkOKGZJ6TsTwBuYu_ZekXaeqT9ag-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2012-06-08 17:39 ` Eric Wong [this message]
[not found] ` <20120608173920.GA20100-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org>
2012-06-08 23:31 ` Eric Wong
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://yhbt.net/rainbows/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20120608173920.GA20100@dcvr.yhbt.net \
--to=normalperson-rmlxzr9ms24@public.gmane.org \
--cc=rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://yhbt.net/rainbows.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).