Arie’s Blog

Yet another Ruby server

March4

Ebb benchRuby Inside just posted a pretty impressive performance graph of a new Ruby server called Ebb. The graph was taken from the homepage of Ebb

Now what is Ebb?

The design is similar to the Evented Mongrel web server; except instead of using EventMachine (a ruby binding to libevent), the Ebb web server is written in C and uses the libev event loop library.

Connections are processed as follows:

  1. libev loops and waits for incoming connections.
  2. When Ebb receives a connection, it passes the request into the mongrel state machine which securely parses the headers.
  3. When the request is complete, Ebb passes the information to a user supplied callback.
  4. The Ruby binding supplying this callback transforms the request into a Rack compatible env hash and passes it on a Rack adapter.

The graph describes performance of a simple rack application and compares Ebb to mongrel, evented mongrel and thin. I’m more interested in performance with a Rails application and decided to do a benchmark for that.

In my benchmark I used the same application I used for my previous benchmark, only this time I benchmarked some extra pages.

Page 1 is a heavily cached page with few dynamic elements

Page 2 is a less cached page with a bit more dynamic elements

Page 3 is a non-cached page with an N+1 performance issue.

Ebb was tested using version 0.0.3, while Thin was on version 0.7.0. Both were run in a cluster of 4 behing nginx as a load balancer.

Ebb vs Thin benchmark

Interestingly Ebb managed to outperform Thin by about 10% on every page.

posted under Programming, Software
9 Comments to

“Yet another Ruby server”

  1. On March 4th, 2008 at 17:03:03 ry Says:

    hi Arie,

    Interesting – although a bit disappointing for me – I’d like to see it do better. How large is the generated html? This was done with ab? which options did you use? Any idea what the rendering time is?

    ry

  2. On March 4th, 2008 at 19:03:20 Arie Says:

    Hi ry, thanks for your comment and for creating Ebb.

    The generated HTML:
    Page 1: 21084 bytes, rendering took 0.0014s
    Page 2: 25909 bytes, rendering took 0.035s
    Page 3: 68883 bytes, rendering took 0.190s

    The tests were run with ab -n 10000 -c 50

  3. On March 4th, 2008 at 21:03:52 ry Says:

    hi arie, on second thought the results are not surprising. handling sockets is a small part of what goes into a rails request – and a vast majority of the overhead will be seen in database connections and template rendering. i wonder what the situation is with merb.

    ry

  4. On March 4th, 2008 at 22:03:54 Arie Says:

    I agree. For this application the database makes up 5% of the request, rendering is the rest. The speed at which Ruby manages to put together a page is the main factor which determines the number of requests per second in this case.

    But it’s nice to get ‘free’ performance increases by using better Ruby servers. Thin improved the number of requests per second by 15% compared to mongrel_cluster. Your Ebb server manages to get another 10% on top of Thin.

  5. On March 7th, 2008 at 04:03:42 j4s0n Says:

    Definitely impressive and super blazing fast. (Except, how can I get back my logs like what we have in mongrel/webrick and others).

    @ry: Thanks man.

  6. On March 7th, 2008 at 05:03:35 j4s0n Says:

    anyway, nvm the log question. i can just do tail -f development.log

  7. On March 27th, 2008 at 11:03:40 Frank Says:

    We had some fun benchmarking thin, ebb, mongrel and direct fastcgi in a few situations (lots of processing, not much processing etc). Read the results at openminds.be

    An interesting read for those not sure what to use.

  8. On March 27th, 2008 at 11:03:39 Arie Says:

    Great benchmarks Frank. I hadn’t seen a any direct comparisons of these new servers versus Lighttpd+FastCG before.

  9. On April 16th, 2008 at 11:04:25 mod_rails vs thin vs ebb vs mongrel | Arie’s Blog Says:

    [...] 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 [...]

Email will not be published

Website example

Your Comment: