Apache ab 压测工具使用说明

1、命令行使用ab命令
  Windows 下 打开cmd进入到apache的bin目录
  Linux 下 直接使用ab命令

2、输入以下命令

	ab -n 1000 -c 10 localhost/

  -n 请求总数
  -c 并发数量
  localhost/ 压测url 域名后面要带上一个斜杠否则会报url无效

3、分析结果

Benchmarking localhost (be patient) //请求完成过程
	Completed 100 requests
	Completed 200 requests
	Completed 300 requests
	Completed 400 requests
	Completed 500 requests
	Completed 600 requests
	Completed 700 requests
	Completed 800 requests
	Completed 900 requests
	Completed 1000 requests
	Finished 1000 requests    


Server Software:        Apache/2.4.23 				//服务器软件版本
Server Hostname:        localhost					//服务器主机
Server Port:            80  						//服务器端口

Document Path:          /  							//文档路径
Document Length:        29918 bytes  				//文档字节

Concurrency Level:      10  						//并发数量
	Time taken for tests:   8.040 seconds  			//测试花费的时间
	Complete requests:      1000    				//完成请求数量
	Failed requests:        0      					//失败请求数量
	Total transferred:      30291000 bytes          //总共传输的字节数  
	HTML transferred:       29918000 bytes			//页面传输的字节数
	Requests per second:    124.38 [#/sec] (mean)   //每秒处理请求数量  
	Time per request:       80.398 [ms] (mean)      //平均响应时间
	Time per request:       8.040 [ms] (mean, across all concurrent requests) //平均请求处理时间
	Transfer rate:          3679.35 [Kbytes/sec] received  // 每秒网络传输的数据量

Connection Times (ms)    //消耗时间分析                
	              min  mean[+/-sd] median   max
Connect:        0    0   0.9      0      10
Processing:    30   80  36.9     70     430
Waiting:       30   78  35.8     70     430
Total:         30   80  36.9     70     430

Percentage of the requests served within a certain time (ms)
	  50%     70
	  66%     80
	  75%     90
	  80%     90
	  90%    120
	  95%    143
	  98%    200
	  99%    230
	 100%    430 (longest request)

//50%的用户响应时间小于70ms
//66%的用户响应时间小于80ms

你可能感兴趣的:(其他,ab)