请求参数说明:
[root@localhost wrk]# ./wrk -h
./wrk: invalid option -- 'h'
Usage: wrk <options> <url>Options:
-c, --connections <N> Connections to keep open(连接数,后面跟数字,表示http连接数)
-d, --duration <T> Duration of test (持续运行时长,如: 2s, 2m, 2h)
-t, --threads <N> Number of threads to use (线程数,后面跟数字,代表启动线程数量) -s, --script <S> Load Lua script file (指定Lua脚本路径 )-H, --header <H> Add header to request (为每一个HTTP请求添加HTTP头 )
--latency Print latency statistics (在压测结束后,打印延迟统计信息 )
--timeout <T> Socket/request timeout (超时时间)
-v, --version Print version details (打印正在使用的wrk的详细版本信息)
Numeric arguments may include a SI unit (1k, 1M, 1G)
Time arguments may include a time unit (2s, 2m, 2h)
测试结果说明:
Running 10s test @ http://127.0.0.1:8089/test/get
10 threads and 2000 connections
Thread Stats Avg(平均) Stdev(标准差) Max(最大) +/- Stdev(正负一个标准差)
Latency 42.59ms 14.57ms 298.03ms 93.27%
Req/Sec 2.41k 1.48k 5.41k 55.20%
Latency Distribution
50% 38.85ms (50%的请求再38.85ms内)
75% 46.06ms (75%的请求再38.85ms内)
90% 54.94ms (90%的请求再38.85ms内)
99% 66.52ms (99%的请求再38.85ms内)
240310 requests in 10.02s, 35.06MB read
Socket errors: connect 0, read 315, write 708, timeout 0
Requests/sec: 23982.45(QPS,平均每秒的请求数)
Transfer/sec: 3.50MB (每秒传输3.59MB的流量)
说明与方法:
标准差:
简单来说,标准差是一组数据平均值分散程度的一种度量。一个较大的标准差,代表大部分数值和其平均值之间差异较大;一个较小的标准差,代表这些数值较接近平均值。标准差如果太大说明样本本身离散程度比较高,有可能系统性能波动较大。
查看当前系统有多少个wrk的线程在工作:
top -H |grep wrk