From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: * X-Spam-ASN: AS33070 50.56.128.0/17 X-Spam-Status: No, score=1.0 required=3.0 tests=AWL,HK_RANDOM_FROM, MSGID_FROM_MTA_HEADER,TVD_RCVD_IP shortcircuit=no autolearn=no version=3.3.2 Path: news.gmane.org!not-for-mail From: Eric Wong Newsgroups: gmane.comp.lang.ruby.rainbows.general Subject: Re: rainbows slower? Date: Fri, 8 Jun 2012 17:39:20 +0000 Message-ID: <20120608173920.GA20100@dcvr.yhbt.net> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1339177230 973 80.91.229.3 (8 Jun 2012 17:40:30 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 8 Jun 2012 17:40:30 +0000 (UTC) To: Rainbows! list Original-X-From: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Fri Jun 08 19:40:26 2012 Return-path: Envelope-to: gclrrg-rainbows-talk@m.gmane.org X-Original-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Delivered-To: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) X-BeenThere: rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Errors-To: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Xref: news.gmane.org gmane.comp.lang.ruby.rainbows.general:357 Archived-At: Received: from 50-56-192-79.static.cloud-ips.com ([50.56.192.79] helo=rubyforge.org) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Sd3Ab-0005hu-Jy for gclrrg-rainbows-talk@m.gmane.org; Fri, 08 Jun 2012 19:40:21 +0200 Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 88D4A3AFF6; Fri, 8 Jun 2012 17:40:20 +0000 (UTC) Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by rubyforge.org (Postfix) with ESMTP id DCC193AFF6 for ; Fri, 8 Jun 2012 17:39:21 +0000 (UTC) Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 0BE1F3F2B6; Fri, 8 Jun 2012 17:39:21 +0000 (UTC) Joseph McDonald 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