使用apache的ab对页面进行压力测试
ab是apache自带的一个很好用的压力测试工具,当安装完apache的时候,就可以在bin下面找到ab
我们可以模拟100个并发用户,对一个页面发送1000个请求
./ab -n1000 -c100 http://www.cnblogs.com/pick/
其中-n代表请求数,-c代表并发数( 详细参数可以用ab --help 查看)
返回结果:
##首先是apache的版本信息
This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking www.cnblogs.com (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:
Server Hostname: www.cnblogs.com
Server Port: 80
Document Path: /pick/
Document Length: 40990 bytes
Concurrency Level: 100 ##并发数
Time taken for tests: 8.385 seconds ##共使用了多少时间
Complete requests: 1000 ##请求数
Failed requests: 616 ##失败请求
(Connect: 0, Receive: 0, Length: 616, Exceptions: 0)
Write errors: 0
Total transferred: 41420957 bytes ##总共传输字节数,包含http的头信息等
HTML transferred: 41111501 bytes ##html字节数,实际的页面传递字节数
Requests per second: 119.27 [#/sec] (mean) ##每秒多少请求,这个是非常重要的参数数值,服务器的吞吐量
Time per request: 838.456 [ms] (mean) ##用户平均请求等待时间
Time per request: 8.385 [ms] (mean, across all concurrent requests) ##服务器平均处理时间,也就是服务器吞吐量的倒数
Transfer rate: 4824.36 [Kbytes/sec] received ##每秒获取的数据长度
Connection Times (ms)
min mean[+/-sd] median max
Connect: 24 225 532.6 29 7028
Processing: 50 396 916.4 88 6164
Waiting: 25 133 473.9 31 3040
Total: 75 621 1095.1 129 7196
Percentage of the requests served within a certain time (ms)
50% 129 ## 50%的请求在129ms内返回
66% 164 ## 66%的请求在164ms内返回
75% 401
80% 1102
90% 1675
95% 3435
98% 4130
99% 4160
100% 7196 (longest request)
说明:考虑到带宽不在测试的范围,ab压力测试应该在内网测试。
使用apache的ab对页面进行压力测试的更多相关文章
- apache的ab进行页面的压力测试
参考http://www.cnblogs.com/yjf512/archive/2011/05/24/2055723.html apache/bin/ab ./ab –n 1000 –c 100 ht ...
- 使用ab进行页面的压力测试
ab是apache自带的一个很好用的压力测试工具,当安装完apache的时候,就可以在bin下面找到ab 参数说明及示例 我们可以模拟100个并发用户,对一个页面发送1000个请求 输入命令:ab - ...
- Webbench、ab命令:做压力测试的工具和性能的监控工具
DDOS攻击:???DDOS概述:分布式拒绝服务(DDoS:Distributed Denial of Service)攻击,指借助于客户/服务器技术,将多个计算机联合起来作为攻击平台,对一个或多个目 ...
- 如何使用 Apache ab 以及 OneAPM 进行压力测试?
下一个 release 准备小长假后就要 go-live ,所有的测试 case 都 cover 过了,但还未进行过压力测试,有点不放心,刚好过节期间家人都回家去了,假期终于可以抽点时间压测一把. A ...
- 使用Apache Server 的ab进行web请求压力测试
参考:http://www.cnblogs.com/spring3mvc/archive/2010/11/23/2414741.html 自己写代码经常是顺着逻辑写下去,写完后run一下,ok就玩完事 ...
- ubuntu中安装apache ab命令进行简单压力测试
1.安装ab命令 写道 apt-get install apache2-utils 2.ab命令参数说明. 写道 Usage: ab [options] [http[s]://]hostname[:p ...
- ab参数详解 – 压力测试
命令参数: -n requests Number of requests to perform //在测试会话中所执行的请求个数.默认时,仅执行一个请求 -c concurr ...
- 用AB对Webservice做压力测试
AB工具下载 AB工具介绍见 web压力测试工具 下载ab工具后放到任意目录下,从命令行打开ab.exe 使用以下命令测试Webservice ab -c 100 -n 1000 -p zip.txt ...
- 【开发者笔记】利用ab命令对接口进行压力测试
目标:对接口进行正确性测试和压力测试 工具:Apache-ab 下载 系统:Windows.linux 目标接口:http://www.stagebo.xyz/foru/lifemonths 命令:a ...
随机推荐
- Java学习笔记--Collection和Collections的区别
转自 http://pengcqu.iteye.com/blog/492196 比较Collection 和Collections的区别. 1.java.util.Collection 是一个集合 ...
- Ubuntu常用命令速查手册-珍藏版-完整版
sudo apt-get install 软件名 安装软件命令 sudo nautilus 打开文件(有root权限) su root 切换到“root” ls 列出当前目录文件(不包括隐含文件) l ...
- 转:AM335x启动流程(BootRom->MLO->Uboot)
http://blog.chinaunix.net/uid-28458801-id-3486399.html 参考文件: 1,AM335x ARM Cortex-A8 Microprocessors ...
- 设置ListView每条数据之间的间隔
1:如果不需要分割线可以在xml布局文件中ListView下设置XML属性: android:divider="#00000000" android:dividerHeight=& ...
- android技术下载
http://www.linuxidc.com/Linux/2011-08/41339.htm http://linux.linuxidc.com/2011%E5%B9%B4%E8%B5%84%E6% ...
- 如何在KEIL中编写模块化的C程序
在KEIL中的模块化程序写法在使用KEIL的时候,我们习惯上在一个.c的文件中把自己要写的东西按照自己思路的顺序进行顺序书写.这样是很普遍的写法,当程序比较短的时候比如几十行或者一百多行,是没有什么问 ...
- C# - 使用ConfigurationManager保存数据到App.config
1. ConfigurationManager的命名空间:using System.Configuration; 2. To be able to save you have to use a con ...
- hdu 5072 Coprime (容斥)
Problem Description There are n people standing in a line. Each of them has a unique id number. Now ...
- java集合类之------Properties
之前经常看到有人在网上问关于HashMap 和Hashtable 的区别,自己也在看,时间一长发现自己也忘了二者的区别,于是在实际应用中犯错了. 原因是使用了Properties 这个集合类时将nul ...
- Adroid APPIUM实例步骤
1.下载eclipse 2.安装java 配置环境变量 3.eclipse 安装adt android development tools 4.android sdk manager 安装tool ...