[Mongrel] multi threaded theoretically useful?

Erik Hetzner erik.hetzner at ucop.edu
Fri Sep 7 19:23:18 EDT 2007


At Fri, 7 Sep 2007 15:39:33 -0700,
Ezra Zygmuntowicz <ezmobius at gmail.com> wrote:
> […]
>
> > On 9/7/07, Erik Hetzner <erik.hetzner at ucop.edu> wrote:

> […]

> >> I know why we are getting greater performance, and again, I don't
> >> think it's artificial. But, in any case, it was a demonstration,
> >> mostly for the original responder, who claimed that you would never
> >> get more performance from Ruby threads.
>
> Yeah I actually said that you would never get more performance out of
> one mongrel running 10 threads then you would with 10 mongrels
> running one thread. Just to clarify ;)

My apologies for misquoting you, and also apologies for referring to
you as ‘the original responder’ - a bit rude, really. :) Here is your
original message:

> Hey Roger-

> No it would not be as fast at all. Current ruby threads are green
> threads, meaning that they do not use native OS threads so there is
> no real parallel execution. Ruby has an internal timer and just
> switches between threads really fast. So 10 mongrels will trounce
> one thread safe mongrel.

> Ruby 1.9, Jruby and Rubinius will eventually have native threads and
> may make this situation better but for now such is life.

I’ve just tested this on my uniprocessor machine. 10 single-threaded
mongrels of my sample sleep + fibonacci web server, balanced behind an
apache load balancer, versus 1 multithreaded mongrels without a load
balancer. The performance, in terms of requests/second, is almost
identical.

best,
Erik Hetzner
;; Erik Hetzner, California Digital Library
;; gnupg key id: 1024D/01DB07E3
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://rubyforge.org/pipermail/mongrel-users/attachments/20070907/d1198563/attachment.bin 


More information about the Mongrel-users mailing list