本篇整理自国外大佬的一个视频,整理成文,方便随时查看。测试机,16核,32G内存。
大佬进行了两种测试,下面分开整理。
1、ab -n 1001 -c 1000 http://localhost:port/ && reset && ab -n 100000 -c 1000 http://localhost:port/
科目 | Vert.x | Actix-web | Warp | Axum |
---|---|---|---|---|
CPU | 1x99% +15x14% | |||
内存 | 780.6 MB | 124.9 MB | ||
总耗时 | 30.791s | 7.816s | 6.774s | 7.032s |
并发数 | 1000 | 1000 | 1000 | 1000 |
处理请求 | 100000 | 100000 | 100000 | 100000 |
失败数 | 0 | 0 | 0 | 0 |
总传数据 | 9.1G | 9.94G | 9.48G | 9.48G |
每秒请求 | 3,247.69 | 12,795.03 | 14,761.42 | 14,220.24 |
Time per request | 307.911 [ms] (mean) | 78.155 [ms] (mean) | 67.744 [ms] (mean) | 70.322 [ms] (mean) |
Time per request | 0.308 [ms] (mean, across all concurrent requests) | 0.078 [ms] (mean, across all concurrent requests) | 0.068 [ms] (mean, across all concurrent requests) | 0.070 [ms] (mean, across all concurrent requests) |
Transfer rate | 310,081.51 [Kbytes/sec] received | 1,334,381.45 [Kbytes/sec] received | 1,467,377.19 [Kbytes/sec] received | 1,413,580.35 [Kbytes/sec] received |
特定时间内(毫秒) 服务的请求百分比 | 50% 305 66% 307 75% 309 80% 310 90% 314 95% 330 98% 350 99% 383 100% 406 | 50% 75 66% 77 75% 78 80% 79 90% 82 95% 84 98% 94 99% 480 100% 1223 | 50% 67 66% 70 75% 71 80% 72 90% 74 95% 75 98% 77 99% 77 100% 1095 | 50% 69 66% 71 75% 72 80% 73 90% 76 95% 78 98% 81 99% 82 100% 1100 |
2、wrk -t 6 c 1000 -d 60s http://localhost:port/users
-
Vert.x
内存:780.3 MB,CPU:1x99% + 15x14% 。
Running 1m test @ http://localhost:8888/
6 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 286.81ms 14.16ms 518.22ms 96.88%
Req/Sec 582.98 202.88 1.20k 63.65%
207674 requests in 1.00m, 18.91GB read
Requests/sec: 3455.97
Transfer/sec: 322.23MB
-
actix-web
内存:124.9 MB,CPU:6x45% + 5x64% + 3x78% + 2x95% 。
Running 1m test @ http://localhost:8083/users
6 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 55.18ms 8.09ms 131.79ms 69.98%
Req/Sec 2.97k 172.47 3.45k 70.25%
1065123 requests in 1.00m, 105.93GB read
Requests/sec: 17728.17
Transfer/sec: 1.76GB
-
warp
内存:27.5 MB,CPU:5x30% + 1x40% + 1x53% + 1x63% + 1x78% + 3x70% 2x98% + 2x100%。
Running 1m test @ http://localhost:8082/users
6 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 53.43ms 38.45ms 348.90ms 73.38%
Req/Sec 3.37k 215.00 4.06k 69.94%
1207865 requests in 1.00m, 114.51GB read
Requests/sec: 20102.66
Transfer/sec: 1.91GB
-
axum
内存:28.2 MB,CPU:2x35% + 2x40% + 4x54% + 3x65% + 2x74% + 2x82% + 1x97% 。
Running 1m test @ http://localhost:3000/users
6 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 61.29ms 44.20ms 466.64ms 72.21%
Req/Sec 2.93k 184.84 4.00k 71.56%
1048424 requests in 1.00m, 99.39GB read
Requests/sec: 17449.80
Transfer/sec: 1.65GB