项目地址https://github.com/wg/wrk
适用平台:linux、windows和MAC;
安装:make后生产wrk执行文件
- 参考命令:
./wrk -t 1 -c 3 -d 120 --timeout 4 --latency -s post_crop.lua http://localhost:8004/detect/cut
1 threads and 3 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 2.53s 255.77ms 3.82s 88.64%
Req/Sec 0.00 0.00 0.00 100.00%
Latency Distribution
50% 2.49s
75% 2.58s
90% 2.78s
99% 3.82s #TP99
45 requests in 2.00m, 76.48MB read
Socket errors: connect 0, read 0, write 0, timeout 1
Requests/sec: 0.37 #QPS
Transfer/sec: 652.57KB
- json脚本内容:
wrk.method = "POST"
wrk.headers["Content-Type"] = "application/json"
wrk.body = '{"service_key":"ef25e85b34208c246cfd09ab76b01db7","timestamp":"1590000000003","images":"http://baidu/img/123.jpg"}'