Tuning a Pack of Mongrels

Posted by Curtis Miller Curtis Miller

After having installed mongrel and mongrel_cluster, I began reading the Tuning article. This article is basically in response to people asking “How many mongrels should I have?” The quick answer is it depends.

The article talks about how to determine what you need because every situation is different. Some of the steps they talk about:

  • Baseline your server by requesting a static file. If your site was entirely static content, then this is the performance you would get. Rarely is a site entirely static these days, but it gives you an idea about what you're shooting for.
  • Run your tests multiple times. This allows for a warm up run and helps reduce the chance you're seeing anomalous behavior.
  • Increase the number of connections until the test runs for 10 seconds.
  • Add mongrel instances to your setup to see the rate increase/decrease. This allows you to tune into how many instances you need.
  • Continuously measure against your benchmark. They use httperf.

The examples use httperf as a tool for adjusting the inputs and gathering the outputs of adding more mongrels, concurrent connections, etc. I did not have httperf installed on my Mac, but it seems that the Apache HTTP server benchmarking tool is already installed with OS X. You can find it and it's options by typing man ab. It gives you some pretty nice information and allows you to specify the number of concurrent connections, number of requests, etc.



Velocity Labs

Need web application development, maintenance for your existing app, or a third party code review?

Velocity Labs can help.

Hire us!