apache/bin/ab.exe文件是一个很好的测试工具,可以模拟多人并发访问网页,从而来检测服务器的性能、查看访问网页的速度。
在windows下面示范:
1、进入命令提示符下
2、进入apache/bin目录下
命令格式:
ab [options] [http://lhostname[:port]/path]
options:
-n requests 执行请求次数
-c concurrency 并发请求数
eg: ab -n 1000 -c 3 http://localhost/index.php
结果:
从结果中可以查看服务器和PHP执行的相关信息。
但实际的效果与这肯定不一样,有带宽等因素