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.3 required=3.0 tests=MSGID_FROM_MTA_HEADER, RDNS_NONE shortcircuit=no autolearn=no version=3.3.2 Path: news.gmane.org!not-for-mail From: "Mark J. Titorenko" Newsgroups: gmane.comp.lang.ruby.rainbows.general Subject: Re: c10k paradigm Date: Tue, 16 Apr 2013 19:19:22 +0100 Message-ID: <37F3CDA5-C42E-4B91-A74F-E748B956D6BF@titorenko.net> References: <516BE872.5060006@objectdata.com.br> <20130415183011.GA27317@dcvr.yhbt.net> <516C2A48.3070808@objectdata.com.br> <20130415193403.GA742@dcvr.yhbt.net> <516D338C.9060408@objectdata.com.br> <20130416172417.GA12658@dcvr.yhbt.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 (Mac OS X Mail 6.3 \(1503\)) Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1366136948 7463 80.91.229.3 (16 Apr 2013 18:29:08 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 16 Apr 2013 18:29:08 +0000 (UTC) To: Rainbows! list Original-X-From: rainbows-talk-bounces-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org Tue Apr 16 20:29:12 2013 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 X-Greylist: delayed 302 seconds by postgrey-1.31 at rubyforge; Tue, 16 Apr 2013 18:24:35 UTC X-CM-Score: 0.00 X-CNFS-Analysis: v=2.1 cv=QMpRGG7L c=1 sm=1 tr=0 a=BwxqRADLO89vPIM/HXXcNg==:117 a=BwxqRADLO89vPIM/HXXcNg==:17 a=1eBd3k10AAAA:8 a=0Bzu9jTXAAAA:8 a=TYuUPCCInQEA:10 a=kj9zAlcOel0A:10 a=y5WZO5ClAAAA:8 a=BMATiAa0n2wA:10 a=Hbzmh3xeAAAA:8 a=fJWvhZdkNyYiV8iNmRoA:9 a=CjuIK1q_8ugA:10 a=BEwxGj72lFYA:10 In-Reply-To: <20130416172417.GA12658-yBiyF41qdooeIZ0/mPfg9Q@public.gmane.org> X-Mailer: Apple Mail (2.1503) X-SA-Exim-Connect-IP: 10.3.1.111 X-SA-Exim-Mail-From: mark-Tt5uHDgV0oUB085IDyDbTA@public.gmane.org X-SA-Exim-Version: 4.2.1 (built Thu, 26 Jun 2008 08:56:56 +0000) X-SA-Exim-Scanned: Yes (on smithers.dmz.titorenko.net) 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 X-Broken-Reverse-DNS: no host name found for IP address 50.56.192.79 Xref: news.gmane.org gmane.comp.lang.ruby.rainbows.general:474 Archived-At: Received: from [50.56.192.79] (helo=rubyforge.org) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1USAcw-0008Eh-Lw for gclrrg-rainbows-talk@m.gmane.org; Tue, 16 Apr 2013 20:29:10 +0200 Received: from localhost.localdomain (localhost [127.0.0.1]) by rubyforge.org (Postfix) with ESMTP id E9CDC2E126; Tue, 16 Apr 2013 18:29:10 +0000 (UTC) Received: from avasout08.plus.net (avasout08.plus.net [212.159.14.20]) by rubyforge.org (Postfix) with ESMTP id 88A762E0BC for ; Tue, 16 Apr 2013 18:23:35 +0000 (UTC) Received: from flanders.lan.titorenko.net ([212.56.103.158]) by avasout08 with smtp id QiKS1l0053R3YU401iKTK8; Tue, 16 Apr 2013 19:19:27 +0100 Received: from smithers.dmz.titorenko.net ([172.16.27.2]) by flanders.lan.titorenko.net with esmtp (Exim 4.69) (envelope-from ) id 1USATW-0000kh-BL for rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org; Tue, 16 Apr 2013 18:19:26 +0000 Received: from dhcp-16.lan.titorenko.net ([10.3.1.111]) by smithers.dmz.titorenko.net with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.69) (envelope-from ) id 1USATT-0007fD-Pk for rainbows-talk-GrnCvJ7WPxnNLxjTenLetw@public.gmane.org; Tue, 16 Apr 2013 18:19:26 +0000 On 16 Apr 2013, at 18:24, Eric Wong wrote: > Did you modify your app to use app.deferred? + TryDefer as I pointed > you to in the other message? > >> Could it be that the controllers of the rails would run without >> party pool threads only with EventMachine (C10K) while others >> would use the controller with EventMachine thread pool (erp)? > > That should allow some rails controllers to use threads > (app.deferred? => true) while others do not use threads > (app.deferred? => false). Keep in mind this is not a very common > configuration, so not many people have experience with it in > production. In case it's of any use I am using #deferred? and TryDefer in my Rails app. I have it set up such that all controller requests are deferred (ie. use threads) apart from those which are, by their nature, asynchronous - eg. I am using Faye mounted at '/ext/bayeux' within my application which already uses the [-1, {}, []] technique to provide an async response. I have #deferred set up by including a module in my Rails::Application instance. In application.rb: module App::Application < Rails::Application require 'extensions/deferred_application' include Extensions::DeferredApplication end In lib/extensions/deferred_application.rb: module Extensions module DeferredApplication BAYEUX_REGEX = %r(^/ext/bayeux(/.*)?$).freeze def deferred?(env) !(env['REQUEST_PATH'] =~ BAYEUX_REGEX) end end end HTH! Cheers, Mark. _______________________________________________ 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