Skip to content

Commit 800c3e9

Browse files
committed
增加压力测试部分
1 parent fa33876 commit 800c3e9

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

doc/day1_express.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -785,6 +785,38 @@ node-inspector是通过websocket方式来转向debug输入输出的。因此,
785785

786786
- nginx
787787
- haproxy
788+
## 压力测试
789+
### ab
790+
791+
ab是apache自带的一个很好用的压力测试工具,当安装完apache的时候,就可以在bin下面找到ab
792+
793+
ab -n1000 -c100 http://127.0.0.1:4100
794+
795+
### wrk
796+
797+
安装
798+
799+
```
800+
git clone https://github.com/wg/wrk
801+
cd wrk
802+
make
803+
sudo cp -rf wrk /bin/
804+
```
805+
806+
测试
807+
808+
```
809+
wrk -t8 -c400 http://127.0.0.1:4100
810+
Running 10s test @ http://127.0.0.1:4100
811+
8 threads and 400 connections
812+
Thread Stats Avg Stdev Max +/- Stdev
813+
Latency 99.83ms 16.70ms 175.72ms 76.86%
814+
Req/Sec 325.50 161.75 665.00 50.27%
815+
22709 requests in 10.01s, 5.65MB read
816+
Socket errors: connect 155, read 3461, write 0, timeout 775
817+
Requests/sec: 2267.99
818+
Transfer/sec: 578.07KB
819+
```
788820

789821
## 阅读文档
790822

0 commit comments

Comments
 (0)