压力测试工具 ab

1.安装ab工具

#查看命令所在包
[root@web01 /server]# yum provides ab

#安装ab
[root@web01 /server]# yum install -y httpd-tools

2.工具使用

[root@web01 ~]# ab -n 200 -c 2 http://linux.try.com/

-n    请求次数
-c    请求的并发数
-k    保持长连接

#语法
Usage: ab [options] [http[s]://]hostname[:port]/path

3.ab测试nginx请求静态页

[root@web01 ~]# ab -n 20000 -c 20 http://www.baidu.com/
原文地址:https://www.cnblogs.com/chenlifan/p/13651893.html