Yet another Ruby server

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.

10 thoughts on “Yet another Ruby server

  1. 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. 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. 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. 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. 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. 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.

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

  8. Pingback: mod_rails vs thin vs ebb vs mongrel | Arie’s Blog

  9. This calls for a complex trial and error process in discovering the eye cream that greatest suits you.
    If you doubt using new product, you have concluded that Life – Cell is
    a fiddle. Do not forget that a proper as well as energetic approach
    to life remains to be the # 1 solution to feeling and young looking.

Leave a Reply

Your email address will not be published.

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>