4 ms·
The advantage of Passenger is that it takes care of dynamically allocating instances of your app, adding them and removing them as needs be. I don't think Mong
by davidw 16y ago
The advantage of Passenger is that it takes care of dynamically allocating instances of your app, adding them and removing them as needs be. I don't think Mongrel ever did this: you had to guess at how many instances you might need and hope for the best. (At least afaik - no one has ever corrected me when I've said that in the past).
- uxp 16y agoYou're correct, Mongrel had predetermined number of instances.
- zedshaw 16y agoI actually wouldn't compete with those servers, because they are very language specific. I'm aiming for Mongrel2 to unify all the languages in the network architecture so that you can do what companies actually do: use what works. I could easily see Passenger or others providing a 0mq connector that Mongrel2 can talk to. Passenger is bad ass at running Ruby, so no point in trying to do that better.
- jfager 16y agoI'm not a Ruby guy, so this might be a stupid question, but: why would you need to run more than a single instance of an app on a given server?
- grandalf 16y agoThat just refers to running multiple processes instead of multiple threads. Rails wasn't thread safe until recently and many ruby libraries still aren't (including the mysql driver). So it's common practice to run a "pack of mongrels" (a few processes simultaneously) and then load balance between them in case a long request ties one up for a while. Mongrel2 will let you effectively design part of your app to benefit from Rails (for example) and part to use 0mq and do a more evented style of design. All within one configuration / approach.
- sandofsky 16y agoRuby 1.8 uses green threads, so running multiple processes lets you use all your cores. As mentioned in another post, Rails used to not be thread safe. Right now I'm running a Rails site in production with multithreading enabled, but I'm sure many libraries in Ruby are not thread safe.
- sandofsky 16y agoI don't understand the benefit of dynamically allocating instances. Why should you be running fewer instance than your server can support?
- davidw 16y agoBecause you have multiple applications.
- sandofsky 16y agoHow do you guard against the situation in which both applications require the maximum number of workers?
- davidw 16y agoYou can't, obviously, any more than you can do much more than monitoring and jumping in with a new server instance if your site suddenly gets 1000 times the traffic it normally does.
- sandofsky 16y agoIt doesn't takes 1000 times the traffic to max out your workers. Imagine if your database (or some other dependency) had abnormally long response times for a minute. I would think that by spinning up more workers than you can support, you slow down all responses. This increases the rate of backup, which increases the need for those extra workers, which slow things down, etc. By keeping workers below the ceiling at all times, requests back up, but you don't degrade performance. I think this makes things much easier to recover. Correct me if I'm wrong about your scenario, since I've never deployed it on a high traffic site.
- davidw 16y agoOh, well you certainly keep the total number of workers below a maximum. All I'm saying is that I have N sites that get different amounts of traffic. If more people are hitting one, I want it to get allocated more passenger instances to handle the traffic. With mongrel, I'd have to, a priori, decide how many mongrels each site gets and hope for the best. With passenger, it dynamically allocates them to handle traffic on an ongoing basis.