Skip to content

Commit 435aa45

Browse files
committed
🚧 wrk
1 parent 36b4d38 commit 435aa45

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

markdown-file/wrk-Install-And-Settings.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,25 @@ Requests/sec: 755.26
4141
Transfer/sec: 11.08MB
4242
```
4343

44+
#### 使用 lua 脚本(发送一个 post 请求)
45+
46+
- 创建:`vim /opt/post-wrk.lua`
47+
48+
```
49+
wrk.method = "POST"
50+
wrk.body = "hms_user_id=222222&routing_key=ad.sys_user.add"
51+
wrk.headers["Content-Type"] = "application/x-www-form-urlencoded"
52+
```
53+
54+
- 测试:`wrk -t10 -c100 -d15s --script=/opt/post-wrk.lua --latency http://127.0.0.1:9090/websocket/api/send-by-user-id`
55+
56+
4457
## 其他说明
4558

4659
- wrk 使用的是 HTTP/1.1,缺省开启的是长连接
4760
- 要测试短连接:`wrk -H "Connection: Close" -c 100 -d 10 http://domain/path`
4861

4962
## 资料
5063

51-
- <https://huoding.com/2017/05/31/620>
64+
- <https://huoding.com/2017/05/31/620>
65+
- <https://zjumty.iteye.com/blog/2221040>

0 commit comments

Comments
 (0)