安装ab
yum -y install httpd-tools
检查是否安装成功
查看ab是否安装成功,可以切换到上述目录下,使用ab –V命令进行检测。如下:
ab -V
进行压力测试
##test.txt参数文件要存在当前目录下
ab -n1 -c1 -T'application/json' -p test.txt http://www.baidu.com/
具体的参数可以通过ab -h
或者Apache官网上查找帮助
ab性能指标
[root@centos ~]$ ab -n1 -c1 -T'application/json' -p test.txt http://www.baidu.com/
This is