yum install httpd-tools
完成后,就可以直接运行ab
# which ab
/usr/bin/ab
# rpm -qf /usr/bin/ab
httpd-tools-2.2.15-47.el6.centos.1.x86_64
# which htpasswd
/usr/bin/htpasswd
压测方法,一定要指定页面名
/usr/bin/ab -n 3000 -c 3000 https://www.baidu.com/index.php
压测之前先执行下面命令
ulimit -n 65535