Skip to content

Instantly share code, notes, and snippets.

@marianposaceanu
Last active November 13, 2016 04:06
Show Gist options
  • Save marianposaceanu/901cf7d5f52b8a5b506b to your computer and use it in GitHub Desktop.
Save marianposaceanu/901cf7d5f52b8a5b506b to your computer and use it in GitHub Desktop.
puma 2.9.0 vs unicorn 4.8.3

Environment info

  • Ruby 2.1.2
  • 2.8Ghz Core i7 / 2 cores - 4 hardware threads / 8G Ram

Unicorn 4.8.3

Using four workers

unicorn -c config/unicorn/development.rb
wrk -t10 -c10 -d10s -s report.lua http://localhost:8080

Results for classic Rails app:

Running 10s test @ http://localhost:8080
  10 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   113.61ms   39.08ms 376.91ms   91.72%
    Req/Sec     8.61      2.02    12.00     75.46%
  907 requests in 10.01s, 27.52MB read
Requests/sec:     90.63
Transfer/sec:      2.75MB
------------------------------
50%,106 ms
90%,147 ms
99%,351 ms
99.999%,376 ms

Results for production API Rails app:

Running 10s test @ http://localhost:8080/entries
  10 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   116.36ms   14.46ms 170.55ms   68.77%
    Req/Sec     8.18      1.69    11.00     41.96%
  858 requests in 10.00s, 447.43KB read
Requests/sec:     85.77
Transfer/sec:     44.73KB
------------------------------
50%,114 ms
90%,133 ms
99%,164 ms
99.999%,170 ms

Puma 2.9.0

Using four workers and eight "green" threads

puma -C config/puma.rb
wrk -t10 -c10 -d10s -s report.lua http://localhost:9292

Results classic Rails app:

Running 10s test @ http://localhost:9292
  10 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   164.12ms  167.98ms 578.62ms   81.84%
    Req/Sec    12.35     10.16    35.00     69.05%
  999 requests in 10.01s, 30.25MB read
Requests/sec:     99.84
Transfer/sec:      3.02MB
------------------------------
50%,70 ms
90%,484 ms
99%,578 ms
99.999%,578 ms

Results for production API Rails app:

Running 10s test @ http://localhost:9292/entries
  10 threads and 10 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency    93.91ms   85.09ms 537.52ms   83.23%
    Req/Sec    15.63      8.09    30.00     58.39%
  878 requests in 10.00s, 396.13KB read
Requests/sec:     87.77
Transfer/sec:     39.60KB
------------------------------
50%,47 ms
90%,256 ms
99%,288 ms
99.999%,537 ms
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment