Comparison between Rack, Sinatra and Webmachine

I am currently looking for different ways of dealing with a high number of requests in a really simple API. The requests will basically store/read some values in Redis. This API will be deployed in a small number of Amazon Micro instances, using the default configuration and running Ubuntu Server 13.04.

I use Ruby for almost a decade, so it was quite natural to evaluate Ruby. I decided that both Rack and Sinatra would be good candidates.

I have been studying Erlang for a couple of months, so I was really curious to see how it would perform in such environment. I decided to create a really simple Webmachine application and evaluate it together to the Rack and Sinatra ones.

About benchmarks

I believe that benchmarks are often misleading and most of people tend to read “the fastest response” as a proof to “A is better than B”. I would like to make clear that these results don’t intend to “proof” anything. They are just the results of the experiments I am working on and those experiments have a specific set of requirements and constraints.

Results

Benchmark graphs
Benchmark graphs

Source code

You can find the application source codes at https://github.com/elvio/api-benchmark.

You might also like

SinatraSimpleRouter

I am open sourcing a project that I have been using a lot lately. You can easily define routes and some rules...

Healthyr - Rails app performance monitor

Open sourcing a lib I created to benchmark Rails apps, using ActiveSupport::Notifications

Download files from a FTP server using Ruby

Download free e-book

Learn different strategies on API versioning with "Versioned APIs with Phoenix" free e-book