[Mongrel] multi threaded theoretically useful?

Ezra Zygmuntowicz ezmobius at gmail.com
Fri Sep 7 14:43:24 EDT 2007


On Sep 7, 2007, at 11:33 AM, Roger Pack wrote:

> So here's a random question: if a (Ruby) multi-threaded rails  
> server could exist (bug free), would it be faster than using a  
> mongrel cluster? (I.e. 10 mongrel processes versus 10 Ruby  
> threads). I'm not sure if it would. RAM it might save, though. Any  
> thoughts? -Roger
> _______________________________________________
> Mongrel-users mailing list
> Mongrel-users at rubyforge.org
> http://rubyforge.org/mailman/listinfo/mongrel-users


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.

Cheers-
-- Ezra Zygmuntowicz 
-- Founder & Ruby Hacker
-- ez at engineyard.com
-- Engine Yard, Serious Rails Hosting
-- (866) 518-YARD (9273)




More information about the Mongrel-users mailing list