wrk

压力测试

wrk

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
$ wrk -c 40 -t 4 -d 3m --latency <http://localhost:9876/test> //使用4线程模拟40个http并发,持续3分钟
Running 3m test @ http://localhost:9876/test
4 threads and 40 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 425.50ms 289.43ms 1.62s 64.72%
Req/Sec 25.39 16.16 100.00 66.34%
Latency Distribution
50% 381.89ms
75% 598.37ms
90% 822.87ms
99% 1.26s
1709 requests in 17.78s, 32.82MB read
$ wrk -c 100 -t 20 -d 100 --latency --timeout 1 -s post.lua http://10.41.41.33:83/expression/click.json
//click.json
wrk.method="POST"
wrk.body = "query=我要报bug2&uid=2008783705&action=add&emoji_id=4"
wrk.headers["Content-Type"] = "application/x-www-form-urlencoded"