Today Phusion released alpha release of Passenger server. They claim that up to 4x faster than Unicorn (emphasis original). Is that true? Let's check this out.

Tools

I'm using wrk which is nice, easy and scriptable HTTP performance tool.

Test application

For testing purposes I've created super simple Sinatra app which do only one thing: serve big HTML file.

class App < Sinatra::Base
  get '/' do
    @foos = (1..1_000)

    erb <<-EOF
    <html>
      <body>
        <ul>
          <% @foos.each do |foo| %>
            <li><%= foo %></li>
          <% end %>
        </ul>
      </body>
    </html>
    EOF
  end
end

Servers

I'm testing Unicorn 4.8.3 vs Passenger 5.0.0.beta1. Unicorn is configured with file that is suggested by Heroku and Passenger run with default options (in standalone version, built in HTTP engine).

Results

Unicorn

Running 30s test @ http://localhost:3000/
  2 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   237.09ms    9.11ms 302.79ms   83.66%
    Req/Sec   210.46     16.08   242.00     55.36%
  12622 requests in 30.01s, 436.10MB read
Requests/sec:    420.65
Transfer/sec:     14.53MB

Running 30s test @ http://localhost:3000/
  2 threads and 50 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   218.18ms   42.60ms 458.14ms   92.04%
    Req/Sec   116.72     15.82   141.00     79.65%
  7009 requests in 30.00s, 242.17MB read
Requests/sec:    233.61
Transfer/sec:      8.07MB

Passenger

Running 30s test @ http://localhost:3000/
  2 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   197.62ms    8.59ms 246.85ms   76.72%
    Req/Sec   253.49      9.74   277.00     72.99%
  15196 requests in 30.00s, 525.44MB read
Requests/sec:    506.51
Transfer/sec:     17.51MB

Running 30s test @ http://localhost:3000/
  2 threads and 50 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   143.81ms   13.92ms 235.12ms   82.14%
    Req/Sec   173.57      5.73   180.00     71.43%
  10101 requests in 30.00s, 349.27MB read
Requests/sec:    336.66
Transfer/sec:     11.64MB

Summary

Maybe this test isn't the best one, but it seems that in this basic test Passenger wins, but not so overwhelming as Phusion claims (1.44x for 50 concurrent requests and 1.20x for 100). I'm waiting for final version and maybe for the first time I'll give Passeger chance in my production app.