c10k paradigm

Eric Wong normalperson at yhbt.net
Tue Apr 16 18:35:00 UTC 2013

Alexandre Riveira <alexandre at objectdata.com.br> wrote:
> >"lock slowness" - which version of Ruby is this?
> ruby 1.9.3p385 (2013-02-06 revision 39114) [i686-linux]

OK, I think you were just unable to take advantage of threading in EM
via app.deferred?

I think you also need to enable threading in Rails, too.

> >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.
> Your suggestion seems to be better, but I'm sorry I did not
> understand where I put this method, the controller would be as
> below?
> class HomeController < ApplicationController
>   def deferred?
>     true
>   end
> end

Probably not, this needs to be visible at the Rack layer, not Rails.

See what Mark just said.  Also, t/app_deferred.ru in the rainbows
source[1].  There's also a link to Ezra's old post about it in the
TryDefer documentation.

[1] - git clone git://bogomips.org/rainbows && $EDITOR t/app_deferred.ru

More information about the rainbows-talk mailing list