programatik29 / rust-web-benchmarks

Benchmarking web frameworks written in rust with rewrk tool.
MIT License
248 stars 33 forks source link

add actix-web example #1

Closed smallfish closed 3 years ago

smallfish commented 3 years ago

benchmark with my MBP(rewrk with -c 100) the results:

$ echo "Results for hyper:" && ./rewrk -t 12 -c 100 -d 10s -h http://localhost:3000/
Results for hyper:
Beginning round 1...
Benchmarking 100 connections @ http://localhost:3000/ for 10 second(s)
  Latencies:
    Avg      Stdev    Min      Max
    1.28ms   0.90ms   0.07ms   9.99ms
  Requests:
    Total: 774594  Req/Sec: 77440.91
  Transfer:
    Total: 65.01 MB Transfer Rate: 6.50 MB/Sec

$ echo "Results for axum:" && ./rewrk -t 12 -c 100 -d 10s -h http://localhost:3000/
Results for axum:
Beginning round 1...
Benchmarking 100 connections @ http://localhost:3000/ for 10 second(s)
  Latencies:
    Avg      Stdev    Min      Max
    1.27ms   0.80ms   0.08ms   8.55ms
  Requests:
    Total: 780470  Req/Sec: 78041.91
  Transfer:
    Total: 66.24 MB Transfer Rate: 6.62 MB/Sec

$ echo "Results for actix-web:" && ./rewrk -t 12 -c 100 -d 10s -h http://localhost:3000/
Results for actix-web:
Beginning round 1...
Benchmarking 100 connections @ http://localhost:3000/ for 10 second(s)
  Latencies:
    Avg      Stdev    Min      Max
    1.55ms   1.82ms   0.07ms   14.54ms
  Requests:
    Total: 642066  Req/Sec: 64173.35
  Transfer:
    Total: 79.60 MB Transfer Rate: 7.96 MB/Sec
smallfish commented 3 years ago

with wrk results:

### hyper
$ wrk -t 12 -c 100 -d 10s --latency http://localhost:3000/
Running 10s test @ http://localhost:3000/
  12 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   642.72us  183.05us   3.03ms   73.80%
    Req/Sec    10.33k   484.82    12.52k    69.47%
  Latency Distribution
     50%  644.00us
     75%  749.00us
     90%    0.85ms
     99%    1.13ms
  1245720 requests in 10.10s, 104.54MB read
Requests/sec: 123328.50
Transfer/sec:     10.35MB

### axum
$ wrk -t 12 -c 100 -d 10s --latency http://localhost:3000/
Running 10s test @ http://localhost:3000/
  12 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency   675.57us  254.13us   6.11ms   72.40%
    Req/Sec    11.16k   651.11    12.95k    67.08%
  Latency Distribution
     50%  647.00us
     75%  814.00us
     90%    1.00ms
     99%    1.39ms
  1346261 requests in 10.10s, 114.27MB read
Requests/sec: 133293.45
Transfer/sec:     11.31MB

### actix-web
$ wrk -t 12 -c 100 -d 10s --latency http://localhost:3000/
Running 10s test @ http://localhost:3000/
  12 threads and 100 connections
  Thread Stats   Avg      Stdev     Max   +/- Stdev
    Latency     1.16ms    2.56ms  82.26ms   93.05%
    Req/Sec    10.98k     0.92k   17.05k    79.25%
  Latency Distribution
     50%  586.00us
     75%  754.00us
     90%    2.82ms
     99%    7.48ms
  1311852 requests in 10.01s, 162.64MB read
Requests/sec: 131074.47
Transfer/sec:     16.25MB