Feed on
Posts
Comments

Scaling and benchmarking Rails.

If you have read the blog posts that we have been making, you might have picked up some clues here that we are building this wonderful service using a beautiful language with a wonderful framework. For the past 2 weeks, we have been working hard to get the infrastructure and building the team that shares this vision - providing an easy, no hassle and social-networking community for salary information seekers.

So this week, I digged hard seeking out various resources on scaling and hosting Payscroll. Ruby has been talked about on the web as the “poor performance” langauge and Rails has the “impossible to scale” framework, so why are we going that direction then? Well, for one, its sort of a “myth” that Rails does not scail well, because if you try searching around the web, I don’t think you ever come across a post or someone rambling about their Rails production site having scaling issues. There have been quite a few high traffic Rails sites that does a couple of million dynamic request a day, and they never had major issues. And as a “lean” startup, you kind of have to “Get Real” with web development, the fact that you are a startup, you have hope and dreams, you have the dream that your app will be used by millions per day. And that’s kind of the goal of very startup. But let’s just be realistic, as a lean startup, you have to be “real” and realized that, yes.. you want to be able to scale so that you can meet your users’ demand but part of getting real is asking yourself as a startup - Will you be ever need to scale that much at this point - the answer is no. And it will be a good thing when the time comes when you need to scale your app and servers to handle 2000 reqs/sec.

The Rails community has been very innovative in pushing out new web server software that works well with Rails. So in our quest to setup our server, we have the chance to test some of the ones that the community is raving about.

Mongrel

Mongrel is a fast HTTP library and server for Ruby that is intended for hosting Ruby web applications of any kind using plain HTTP rather than FastCGI or SCGI. It is framework agnostic and already supports Ruby On Rails, Og+Nitro, and Camping frameworks.

Mongrel is a popular choice for back-end server for serving dynamic request for Rails. So I decided to give it a try. Mongrel also has an addon call “Mongrel Cluster” that allows you to spawn N mongrel threads and run Mongrel as a cluster. Way cool. So using a front-end proxy balancer, you can push the dynamic request out to back-end application server/s running the mongrel threads. Popular front-end servers includes Apache2 and the Nginx (like “engine-X”). So I decided to give both a try, and it turns out that Apache2 performed slight better than Nginx but it was just in the range of 10+- reqs/sec. So there is no compelling reasons to go whichever way.

So I decided to checkout another new kid on the block - the Litespeed Technologies web server, in the next few days and run some results and see how each setup performs running our app right now rather than just benchmarking with a hello app. And I’ll update any findings here.
Litespeed Web server

LiteSpeed web server is a high performance, secure and easy-to-use web server, which can handle thousands of concurrent connections with a small memory footprint. It is less vulnerable when facing various attacks.

Here’s some interesting post around the web that benchmarking Rails, and hopefully it will answer some other questions you have.

My Rails Benchmark results: LSWS + LSAPI vs nginx + FCGI

High-Performance Ruby On Rails Setups Test: mongrel vs lighttpd vs nginx

4 Responses to “Scaling and benchmarking Rails.”

  1. […] And now on to the real exciting part. Benchmarking my container with “ApacheBench”. To do the benchmarking, I use the same test that I mentioned in my previous post, Scaling and Benchmarking Rails, and run the same test, ab -n 10000 -c 200 http://app.s351.gridserver.com/ . I have put the ab output at the bottom of the post if you are interested. But here’s a summary of the results. Mediatemple’s (gs) tops the other Rail hosting providers that I’ve tried and was able to handle approximately ~39 requests/sec at currency level of 100 which is pretty good compared to other shared hosting packages that I have tried: […]

  2. […] To do the benchmarking, I use the same test that I mentioned in my previous post, Scaling and Benchmarking Rails, and run the same test, ab -n 10000 -c 200 http://app.s351.gridserver.com/ . I have put the ab […]

  3. on 27 Jan 2008 at 8:29 pm Outfibuff

    Good site
    http://www.google.com - xamasapa

  4. on 08 Oct 2008 at 1:35 am werutzb

    Hi!

    I would like extend my SQL experience.
    I red that many SQL resources and would like to
    get more about SQL for my position as db2 database manager.

    What would you recommend?

    Thanks,
    Werutz

Trackback URI | Comments RSS

Leave a Reply