Today, our first project done in Ruby on Rails went live.
Christoph has done a wonderful job on it. The only thing I had to do was to fix up some CSS buglets in IE and install a deployment environement (developement was done using the Rails-integrated WEBRick server)
Personally, I think I’d have preferred using LightTPD with FastCGI instead of Apache, but the current setup pretty much prevented me from doing so.
Which is why I’ve installed mod_fastcgi on apache which was very, very easy on Gentoo (emerge mod_fastcgi – as usual).
Once I’ve corrected the interpreter path in dispatch.fcgi (which was set to the location of Christophs developement environment), the thing began working quite nicely.
And fast.
Considering the incredible amount of magic rails does behind the scenes, those 73.15 requests per second I got are very, very impressive (ab -n 100 -c 5). And actually so much faster than a comparable PHP application running using mod_php on a little faster server (19.36 req/s, same ab call).
The results have to be taken with a grain of salt as it’s different machines, different load and a different application.
But it’s similar enough to be comparable for me: the PHP application is running on a framework somewhat similar to rails with lesser optimization but also with lesser complexity. Both benchmarks ran against the unauthenticated start page which comes pretty much down to including some files and rendering a template. No relevant database queries.
I wonder how much of this higher speed is caused by FastCGI (a very convincing technology) instead of running the code in the apache server itself and how much is just rails being faster.
I will set up a test environement which is better defined to actually allow an accurate performance comparison: Comparable application in mod_php, php-fastcgi and rails-fastcgi. And if I have time, I’m going to run the two fastcgi-tests on LightTPD aswell.
Benchmarking is fun. Time-consuming, but fun.
For now, I’m content with the knowledge that an application that took a very small effort to write (even considering that Christoph had to learn the rails environment first) is running fast enough for its intended purpose.
As Christoph said: Rails Rules
thanks, guys