5 ms·
Here's what's annoying about Mongrel, summed up: > As the title of this article suggests, only 7 mongrels were required to sustain the level of traffic. (this
by davidw 19y ago
Here's what's annoying about Mongrel, summed up:
> As the title of this article suggests, only 7 mongrels were required to sustain the level of traffic. (this number was already set to seven before the digging, and didn't have to be increased)
Having to pick arbitrary numbers beforehand is a bad way of scaling. Apache with fcgid launches new processes as they're needed. It may not scale due to other problems, but "pick a number and pray" strikes me as a dubious idea.
- mrtron 19y agoI am wondering why X mongrels are commonly used with Rails, is it just how mongrel is designed and dispatched that you need to establish X amount and it does not change with the load? Being completely ignorant of mongrel, what is the benefit of having 7 mongrels running instead of 1? Does it not just do the job of dispatching the child processes to handle requests, so one would handle things just as effectively? I suppose what I am asking is, with one box why would you have more than one dispatcher?
- socmoth 19y agoone mongrel handles one request. if you request takes one second to complete. you get one request/sec. 7 mongrels => 7 req/sec. 100req/sec * 7 mongrels => 700 req/sec total. and other simple math. they aren't spawned automatically. you setup a number and distribute to them. there are ways of getting them to spawn automatically, but it isn't inherent to mongrel itself.
- mrtron 19y agoOh, I see, thanks. So I now ask, why have not spawn them automatically?
- sbraford 19y agoThat's a really good question, eh? :) It seems to me the webserver would then need to support that (dynamic allocation of additional target mongrels). The way it works currently is you put Apache2 / Lighty / nginx / etc in front, working as a proxy, which has a list of host/port pairs which it forwards on the request to. The proxying end of things would have to be smart enough to tell mongrel to startup more processes, and begin forwarding more requests to those.
- davidw 19y agoWhereas, with something like Rivet or Websh (or PHP for that matter, even if I don't like the language), it's good old tried and true Apache taking care of dynamically allocating new servers as needs be... fancy that! I love Rails, but those guys are too anxious to throw the Apache baby out with the PHP bathwater.
- sbraford 19y agoI agree, being forced to know ahead of time how many mongrels you'll need is sub-optimal. At the same time, it's trivial to switch this number if you've not hit your server resource limits yet. (i.e. when coming under a digg load) Once server limits are reached (in Apache or nginx/mongrel/rails), the point is moot - you'll have to instantiate new servers at your co-lo / hosting company by hand anyway. All that said, nginx is a fantastic web & proxy server. It blows Apache out of the water in terms of memory usage, etc.
- davidw 19y agonginx - isn't it just another in a long line of select-based web servers that "blow Apache out of the water" when it comes to serving static resources? boa was what I set up to serve static files at Linuxcare back in ... 1999? Or is nginx different somehow? That's fine as far as it goes, but the tricky part lies in serving up the dynamic stuff.
- carpal 19y agoNginx is both incredibly fast at serving static files and pretty useful all around for reverse proxies and whatnot (not to mention being easier to configure/maintain than apache). I use it at work and it has been fantastic.
- altano 19y agoIt's not select based, it is event based, utilizing the relatively new support for event-driven IO in the Linux and FreeBSD kernels (kqueue/epoll).
- socmoth 19y agoi just noticed replies. mongrel doesn't do it for the same reason tar doesn't support encryption (pgp does!). mongrel is designed to serve requests, not balance requests or spawn itself. sure it could, but it doesn't have to. it is just as easy to have another project spawn more mongrels. That way if I want to to write software just for looking at my servers and making more mongrels, i can, very easily. Otherwise i have to look in mongrel's code.
- carpal 19y agoI really like the approach of having X number of processes started automatically. You can get really fine-grained in your scaling strategy, and can balance multiple projects on the same server much better than you could with Apache. If you really want the "automatic blah blah blah" approach, you can always use fcgi with Apache. Many people do (including 37signals).