Skip to content

Instantly share code, notes, and snippets.

@foi
Last active July 2, 2016 01:47
Show Gist options
  • Select an option

  • Save foi/1050ec60e56cf0f31a6f75bfb752fef5 to your computer and use it in GitHub Desktop.

Select an option

Save foi/1050ec60e56cf0f31a6f75bfb752fef5 to your computer and use it in GitHub Desktop.

Revisions

  1. foi revised this gist Jul 2, 2016. 1 changed file with 22 additions and 2 deletions.
    24 changes: 22 additions & 2 deletions benchmark.md
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,18 @@
    ~~~~
    linux kernel 4.6.2
    Core i7 3770
    8GB DDR3 1600Mhz ram
    8GB DDR3 1600Mhz
    ~~~~

    # Languages

    ~~~~
    ruby 2.3.1
    nodejs 6.2.2
    elixir 1.3.1
    go 1.6.2
    java 8.u92
    ~~~~

    # Method

    @@ -18,6 +22,7 @@ Benchmark with: wrk -c 400 -t 8 -d 30s http://localhost:PORT/

    ## Sinatra 1.4.7, puma 2.10.2

    ~~~~
    puma -w 8 -e production
    Running 30s test @ http://localhost:9292/
    @@ -30,8 +35,11 @@ Running 30s test @ http://localhost:9292/
    Requests/sec: 22485.05
    Transfer/sec: 4.61MB
    ~~~~

    ## Rails 4.1.9, puma 3.4.0

    ~~~~
    puma -w 8 -e production
    wrk -c 400 -t 8 -d 30s http://localhost:3000/
    @@ -43,9 +51,10 @@ Running 30s test @ http://localhost:3000/
    137019 requests in 30.05s, 301.46MB read
    Requests/sec: 4560.15
    Transfer/sec: 10.03MB
    ~~~~

    ## Cuba 3.4.0, puma 2.10.2

    ~~~~
    RACK_ENV=production bundle exec puma -t 1:16 -w 8 -p 9292 --preload
    wrk -c 400 -t 8 -d 30s http://localhost:9292/
    @@ -58,11 +67,13 @@ Running 30s test @ http://localhost:9292/
    Non-2xx or 3xx responses: 1680350
    Requests/sec: 55842.85
    Transfer/sec: 3.14MB
    ~~~~

    # nodejs

    ## Express 4.14

    ~~~~
    NODE_ENV=productiob node server.js -w 8
    wrk -c 400 -t 8 -d 30s http://localhost:3000/
    @@ -75,27 +86,33 @@ Running 30s test @ http://localhost:3000/
    Non-2xx or 3xx responses: 1640263
    Requests/sec: 54521.39
    Transfer/sec: 11.23MB
    ~~~~

    # Elixir

    ## Plug 0.14.0

    ~~~~
    sudo MIX_ENV=prod elixir -pa _build/prod/consolidated -S mix server
    Compiling 1 file (.ex)
    == Compilation error on file lib/benchmarker.ex ==
    ** (CompileError) lib/benchmarker.ex:1: undefined function fetch_params/2
    (stdlib) lists.erl:1338: :lists.foreach/2
    (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6
    ~~~~

    ## Phoenix

    ~~~~
    FAILED
    ~~~~

    # Go 1.6.2

    ## Martini (02.07.2016)

    ~~~~
    GOMAXPROCS=8 MARTINI_ENV=production go run server.go
    wrk -c 400 -t 8 -d 30s http://localhost:3000/
    @@ -108,9 +125,11 @@ Running 30s test @ http://localhost:3000/
    Non-2xx or 3xx responses: 925620
    Requests/sec: 30831.25
    Transfer/sec: 5.17MB
    ~~~~

    ## Gin (02.07.2016)

    ~~~~
    GOMAXPROCS=8 GIN_MODE=release go run server.go
    wrk -c 400 -t 8 -d 30s http://localhost:3000/
    @@ -123,6 +142,7 @@ Running 30s test @ http://localhost:3000/
    Non-2xx or 3xx responses: 5045347
    Requests/sec: 167834.53
    Transfer/sec: 20.33MB
    ~~~~

    # Java 8.u92

  2. foi created this gist Jul 2, 2016.
    131 changes: 131 additions & 0 deletions benchmark.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,131 @@
    linux kernel 4.6.2
    Core i7 3770
    8GB DDR3 1600Mhz ram

    # Languages

    ruby 2.3.1
    nodejs 6.2.2
    elixir 1.3.1
    go 1.6.2
    java 8.u92

    # Method

    Benchmark with: wrk -c 400 -t 8 -d 30s http://localhost:PORT/

    # Ruby

    ## Sinatra 1.4.7, puma 2.10.2

    puma -w 8 -e production

    Running 30s test @ http://localhost:9292/
    8 threads and 400 connections
    Thread Stats Avg Stdev Max +/- Stdev
    Latency 7.19ms 14.43ms 299.98ms 90.21%
    Req/Sec 3.24k 3.98k 20.98k 71.54%
    676676 requests in 30.09s, 138.75MB read
    Non-2xx or 3xx responses: 676676
    Requests/sec: 22485.05
    Transfer/sec: 4.61MB

    ## Rails 4.1.9, puma 3.4.0

    puma -w 8 -e production

    wrk -c 400 -t 8 -d 30s http://localhost:3000/
    Running 30s test @ http://localhost:3000/
    8 threads and 400 connections
    Thread Stats Avg Stdev Max +/- Stdev
    Latency 27.98ms 41.21ms 261.47ms 74.97%
    Req/Sec 575.59 421.36 1.63k 50.21%
    137019 requests in 30.05s, 301.46MB read
    Requests/sec: 4560.15
    Transfer/sec: 10.03MB

    ## Cuba 3.4.0, puma 2.10.2

    RACK_ENV=production bundle exec puma -t 1:16 -w 8 -p 9292 --preload

    wrk -c 400 -t 8 -d 30s http://localhost:9292/
    Running 30s test @ http://localhost:9292/
    8 threads and 400 connections
    Thread Stats Avg Stdev Max +/- Stdev
    Latency 2.93ms 7.38ms 310.73ms 96.74%
    Req/Sec 7.03k 7.49k 42.23k 65.03%
    1680350 requests in 30.09s, 94.55MB read
    Non-2xx or 3xx responses: 1680350
    Requests/sec: 55842.85
    Transfer/sec: 3.14MB

    # nodejs

    ## Express 4.14

    NODE_ENV=productiob node server.js -w 8

    wrk -c 400 -t 8 -d 30s http://localhost:3000/
    Running 30s test @ http://localhost:3000/
    8 threads and 400 connections
    Thread Stats Avg Stdev Max +/- Stdev
    Latency 7.71ms 9.87ms 357.26ms 99.29%
    Req/Sec 6.87k 729.74 17.36k 86.98%
    1640263 requests in 30.08s, 337.88MB read
    Non-2xx or 3xx responses: 1640263
    Requests/sec: 54521.39
    Transfer/sec: 11.23MB

    # Elixir

    ## Plug 0.14.0

    sudo MIX_ENV=prod elixir -pa _build/prod/consolidated -S mix server
    Compiling 1 file (.ex)

    == Compilation error on file lib/benchmarker.ex ==
    ** (CompileError) lib/benchmarker.ex:1: undefined function fetch_params/2
    (stdlib) lists.erl:1338: :lists.foreach/2
    (stdlib) erl_eval.erl:670: :erl_eval.do_apply/6

    ## Phoenix

    FAILED

    # Go 1.6.2

    ## Martini (02.07.2016)

    GOMAXPROCS=8 MARTINI_ENV=production go run server.go

    wrk -c 400 -t 8 -d 30s http://localhost:3000/
    Running 30s test @ http://localhost:3000/
    8 threads and 400 connections
    Thread Stats Avg Stdev Max +/- Stdev
    Latency 19.53ms 23.69ms 282.86ms 84.74%
    Req/Sec 3.91k 484.52 8.47k 80.59%
    925620 requests in 30.02s, 155.36MB read
    Non-2xx or 3xx responses: 925620
    Requests/sec: 30831.25
    Transfer/sec: 5.17MB

    ## Gin (02.07.2016)

    GOMAXPROCS=8 GIN_MODE=release go run server.go

    wrk -c 400 -t 8 -d 30s http://localhost:3000/
    Running 30s test @ http://localhost:3000/
    8 threads and 400 connections
    Thread Stats Avg Stdev Max +/- Stdev
    Latency 2.47ms 1.97ms 205.65ms 78.25%
    Req/Sec 21.11k 2.80k 47.53k 76.21%
    5045347 requests in 30.06s, 611.08MB read
    Non-2xx or 3xx responses: 5045347
    Requests/sec: 167834.53
    Transfer/sec: 20.33MB

    # Java 8.u92

    ## Play

    Too slow at installing dependencies... do not like this