cargo run
wrk -t12 -c400 -d120s http://127.0.0.1:8080/fibonacci/80
Running 2m test @ http://127.0.0.1:8080/fibonacci/80
12 threads and 400 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 7.99ms 4.59ms 137.68ms 89.93%
Req/Sec 2.56k 1.24k 6.31k 63.54%
3670936 requests in 2.00m, 381.60MB read
Socket errors: connect 155, read 102, write 0, timeout 0
Requests/sec: 30564.57
Transfer/sec: 3.18MB
docker build -t rust_api .
docker run -p 8080:8080 rust_api
测试项 | Rust | NodeJS | 请求量 |
---|---|---|---|
启动 | ![]() |
![]() |
没有请求 |
10线程 | ![]() |
![]() |
![]() |
100线程 | ![]() |
![]() |
![]() |
300线程 | ![]() |
![]() |
![]() |
500线程 | ![]() |
![]() |
![]() |
1000线程 | ![]() |
![]() |
![]() |
2000线程 | ![]() |
![]() |
![]() |
3000线程 | ![]() |
![]() |
![]() |