c10k paradigm

Alexandre Riveira alexandre at objectdata.com.br
Tue Apr 16 15:45:59 UTC 2013


This is valid for ruby on rails 2.3?

Em 16-04-2013 18:19, Mark J. Titorenko escreveu:
> On 16 Apr 2013, at 18:24, Eric Wong <normalperson at yhbt.net> 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 at rubyforge.org
> http://rubyforge.org/mailman/listinfo/rainbows-talk
> Do not quote signatures (like this one) or top post when replying
>



More information about the rainbows-talk mailing list