mod_rails vs thin vs ebb vs mongrel
With the recent release of mod_rails, I thought it was time for yet another benchmark. Mod_rails aims to make deployment of RubyOnRails applications comparable to deploying a PHP application on a shared host.
The contestants
mod_rails (Apache 2.2.8)
Thin 0.8.0 (Cluster of 4 behind nginx 0.5.33, both TCP and Unix socket)
Ebb 0.1.0 (Cluster of 4 behind nginx 0.5.33)
Mongrel 1.1.4 (Cluster of 4 behind nginx 0.5.33)
The benchmark is the index page of Leef je doel, the hardware used is a Dell D830 laptop with a T7300 (speedstep disabled), 2GB of RAM and a 7200RPM harddisk. The page runs a few queries and also serves a lot of fragments from memcached.
The results
| -n 10000 -c 10 |
-n 10000 -c 50 | |
| mod_rails | 79.2 | 77.4 |
| thin(tcp) | 84.22 | 84.06 |
| thin(socket) | 86.4 | 87.65 |
| ebb | 93.2 | 91.2 |
| mongrel | 79.22 | 75.92 |
Performance
Like my previous test, Ebb comes out on top, closely followed by Thin.
Using the default Apache2 config supplied by Ubuntu, mod_rails shows performance equal to mongrel_cluster behind nginx. I’m sure that by tweaking the Apache config files, some performance can be gained.
Compared to setting up nginx and thin/ebb/mongrel, setting up mod_rails is a lot simpler. Have a look at their screencast to see how easy it is, if you have a working Apache2, you’ll have mod_rails up and running within minutes. There are some small issues with mod_rails at the moment, for a list, check mod_rails’ Google Code page.

[...] It looks at Passenger’s memory use and how Passenger integrates with Apache (somewhat). mod_rails vs thin vs ebb vs mongrel – A comparison of four different Rails serving techniques. Ebb appears to have the edge. [...]
[...] when i thought it was safe to use thin… here comes another performance analysis… Leave a [...]
[...] performance tests show it to be pretty fast, and it uses shared memory in a better way than mongrel, making it [...]
[...] Here’s a good post on Passenger versus Thin, and here is a better benchmark that includes thin on nginx. [...]
I wonder what is the memory usage on the server, what would be more effective many Thin processes behind Apache load balancer or a single Apache with lots of child processes ???
I wouldn’t recommend Apache at all for serving Thin. Nginx is a lot more efficient at serving static files and load balancing.
Could you explain what means
-n 10000 -c 10
-n 10000 -c 50
Maybe some update for mod_rails + nginx?
Thx for your work!
10000 requests with a concurrency of 10, and 10000 requests with a concurrency of 50.
Good info thanks! I’m very curious to see what the memory usage was on these though??
I would happily sacrifice 10% in speed if it meant half the memory usage or something similar.
Thanks!
Brian
vs.
I didn’t understand and haven’t learned either ruby or its framework rails. But really read the mongrel and thin servers several times. are those server softwares dedicated to the ruby web application? can there be load-balancer for the web applications based upon other language?
Thin and Mongrel are just Ruby webservers, not load balancers.
If you need a general load balancer, look at Apache2′s mod_proxy or nginx.