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: AS14383 205.234.109.0/24 X-Spam-Status: No, score=1.0 required=3.0 tests=AWL,HK_RANDOM_FROM, MSGID_FROM_MTA_HEADER 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: rails 2 and slow external services Date: Tue, 14 Dec 2010 04:57:20 +0000 Message-ID: <20101214045720.GC5051@dcvr.yhbt.net> References: <20101213103936.GA8440@dcvr.yhbt.net> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1292304175 26737 80.91.229.12 (14 Dec 2010 05:22:55 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 14 Dec 2010 05:22:55 +0000 (UTC) To: Rainbows! list Original-X-From: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Tue Dec 14 06:22:51 2010 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.18 (2008-05-17) 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:169 Archived-At: Received: from rubyforge.org ([205.234.109.19]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PSNLf-000215-0X for gclrrg-rainbows-talk@m.gmane.org; Tue, 14 Dec 2010 06:22:51 +0100 Received: from rubyforge.org (rubyforge.org [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id 5483C185834E; Tue, 14 Dec 2010 00:22:50 -0500 (EST) Received: from dcvr.yhbt.net (dcvr.yhbt.net [64.71.152.64]) by rubyforge.org (Postfix) with ESMTP id 4452E1858346 for ; Mon, 13 Dec 2010 23:57:21 -0500 (EST) Received: from localhost (unknown [127.0.2.5]) by dcvr.yhbt.net (Postfix) with ESMTP id 65FBA29686F; Tue, 14 Dec 2010 04:57:20 +0000 (UTC) ghazel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > > ghazel-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org wrote: > >> Some of my page loads (currently serviced by Unicorn) spend a great > >> deal of time waiting for external services (OpenID, OAuth, etc over > >> Net::HTTP and curb), so I'm looking at Rainbows!. I use Rails 2.3.10. > > This is Ruby 1.8.7 (REE). Is there any interesting difference between > ThreadPool and ThreadSpawn in this environment? ThreadPool is generally more predictable, but ThreadSpawn has lower memory usage if your traffic spikes are intermittent or low. ThreadSpawn is much like the original Mongrel and ThreadPool was an experiment with Ruby 1.9 in mind. 1.9 has more expensive (but slightly more concurrent) threading. If your bottlenecks are external HTTP requests on 1.8, but first instinct would be to use ThreadSpawn. Ruby 1.9 + ThreadPool would probably be well-suited for large file serving to LAN clients with many slowish disks as it can use sendfile via IO.copy_stream), but if you can afford the constant memory overhead, it could be good in 1.8, too. > I also make use of a (heavily modified, which is another topic) OobGC. > Does anyone know if garbage collection in ruby 1.8.7 is reasonably > threadable? I expect not, but one can hope. It is not, the entire interpreter stops running every single thread for GC. I don't think using OobGC with any of the Rainbows! concurrency models will work, only :Base and Unicorn. -- Eric Wong _______________________________________________ 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