mirror of
https://github.com/sogou/workflow.git
synced 2026-02-08 01:33:17 +08:00
improve benchmark document
add testing steps.
This commit is contained in:
@@ -57,6 +57,33 @@ HTTP Client/Server是Sogou C++ Workflow常见的应用场景,
|
||||
|
||||
下面依次介绍两个测试场景。
|
||||
|
||||
### 测试方法
|
||||
|
||||
#### 启动http server
|
||||
1. 编译benchmark
|
||||
2. 进入到benchmark目录,执行
|
||||
|
||||
```
|
||||
./http_server 12 9000 11
|
||||
```
|
||||
|
||||
说明: 启动参数分别为线程数、端口和响应的随机字符串长度。
|
||||
|
||||
### wrk测试
|
||||
|
||||
```
|
||||
wrk --latency -d10 -c200 --timeout 8 -t 6 http://127.0.0.1:9000
|
||||
```
|
||||
**命令行解释**
|
||||
|
||||
-c200: 启动200个连接
|
||||
|
||||
-t6: 开启6个线程做压力测试
|
||||
|
||||
-d10: 压测持续10s
|
||||
|
||||
--timeout 8: 连接超时时间8s
|
||||
|
||||
### 不同并发度和数据长度下的QPS和延时
|
||||
|
||||
#### 代码和配置
|
||||
|
||||
Reference in New Issue
Block a user