目录
按照Apache Bench
yum install -y httpd-tools
ab -n 20000 -c 20000 http://172.16.0.8/
循环请求
while true; do ab -n 10000 -c 10000 -t 30 -H 'Accept-Encoding: gzip' -k http://172.16.0.2/ && sleep 5; done
有些时候我们需要测试用户登录性能,而一般登录程序都采用POST方式提交数据。
准备POST 文件 /home/neo/post.txt
$ cat /home/neo/post.txt username=neo&password=chen
使用-p引用文件
ab -n 2048 -c 2048 -p post.txt http://www.example.com/login.php