码迷,mamicode.com
首页 > 其他好文 > 详细

apache ab工具压力测试

时间:2014-07-06 19:33:13      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   color   使用   os   

apache本身自带了一个测试工具ab,在apache的安装目录bin目录下

ab的使用方法:

Usage: ab [options] [http[s]://]hostname[:port]/path

-n 测试会话中所执行的请求个数,默认时,仅执行一个请求
-c 一次产生的请求个数。默认是一次一个
-t 测试所进行的最大秒数
-v 设置显示信息的详细程度 - 4或更大值会显示头信息, 3或更大值可以显示响应代码(404, 200等), 2或更大值可以显示警告和其他信息。 -V 显示版本号zui

最常用的参数是 -n 和 -c 例如:

root@:localhost:/usr/local/apache/bin> ./ab -n1000 -c10 http://localhost/index.php
This is ApacheBench, Version 2.3 <$Revision: 1528965 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking 192.168.90.222 (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: Boa/0.94.13 Server Hostname: 192.168.90.222 Server Port: 80 Document Path: / Document Length: 41 bytes Concurrency Level: 10 Time taken for tests: 0.173 seconds Complete requests: 1000 Failed requests: 0 Total transferred: 228000 bytes HTML transferred: 41000 bytes Requests per second: 5780.51 [#/sec] (mean) Time per request: 1.730 [ms] (mean) Time per request: 0.173 [ms] (mean, across all concurrent requests) Transfer rate: 1287.07 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 0 0 0.2 0 1 Processing: 0 1 7.8 1 80 Waiting: 0 1 7.3 0 76 Total: 0 2 7.7 1 80 Percentage of the requests served within a certain time (ms) 50% 1 66% 1 75% 1 80% 1 90% 1 95% 1 98% 2 99% 76 100% 80 (longest request)

 

apache ab工具压力测试,布布扣,bubuko.com

apache ab工具压力测试

标签:style   blog   http   color   使用   os   

原文地址:http://www.cnblogs.com/jinhy/p/3824705.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!