Quick mongrel load testing trick
Zed’s How many mongrels tutorial gives a good idea on how to load test mongrels to determine how many mongrels you should run on your box. Here’s a little trick that makes it easier and quicker to test…
First, set up your mongrel cluster for as many mongrels as you would like to maximally load test. For example, let’s say you launch N mongrels. The trick is to start N pen load balancer processes for which each successive port refers to more and more mongrels. Example:
You have 8 mongrels on ports 3001-3008. Now launch 8 pens:
pen -r -H 4001 http://localhost:3001 pen -r -H 4002 http://localhost:3001 http://localhost:3002 ... pen -r -H 4008 http://localhost:3001 ...(6 more)... http://localhost:3008
Thus each pen on port 400N refers to N mongrels. So to load test 1 mongrel hit 4001, to test five mongrels, hit 4005. Now granted this isn’t perfect since the other mongrels are taking up some system resources by just idling there, but if you have ample memory on the system, this could be a quick and dirty way to find out how many mongrels you really need. Enjoy!










1 Comment