ubuntu下 使用AB做压力测试
1最近刚开始接触apache大数据下数据优化,讲一下apache 下ab压力测试工具。
程序“ab”尚未安装。 您可以使用以下命令安装:
apt-get install apache2-utils
以下是ab --help
sage: ab [options] [http[s]://]hostname[:port]/path
Options are:
-n requests Number of requests to perform
-c concurrency Number of multiple requests to make at a time
-t timelimit Seconds to max. to spend on benchmarking
This implies -n
-s timeout Seconds to max. wait for each response
Default is seconds
-b windowsize Size of TCP send/receive buffer, in bytes
-B address Address to bind to when making outgoing connections
-p postfile File containing data to POST. Remember also to set -T
-u putfile File containing data to PUT. Remember also to set -T
-T content-type Content-type header to use for POST/PUT data, eg.
'application/x-www-form-urlencoded'
Default is 'text/plain'
-v verbosity How much troubleshooting info to print
-w Print out results in HTML tables
-i Use HEAD instead of GET
-x attributes String to insert as table attributes
-y attributes String to insert as tr attributes
-z attributes String to insert as td or th attributes
-C attribute Add cookie, eg. 'Apache=1234'. (repeatable)
-H attribute Add Arbitrary header line, eg. 'Accept-Encoding: gzip'
Inserted after all normal header lines. (repeatable)
-A attribute Add Basic WWW Authentication, the attributes
are a colon separated username and password.
-P attribute Add Basic Proxy Authentication, the attributes
are a colon separated username and password.
-X proxy:port Proxyserver and port number to use
-V Print version number and exit
-k Use HTTP KeepAlive feature
-d Do not show percentiles served table.
-S Do not show confidence estimators and warnings.
-q Do not show progress when doing more than requests
-l Accept variable document length (use this for dynamic pages)
-g filename Output collected data to gnuplot format file.
-e filename Output CSV file with percentages served
-r Don't exit on socket receive errors.
-h Display usage information (this message)
-Z ciphersuite Specify SSL/TLS cipher suite (See openssl ciphers)
-f protocol Specify SSL/TLS protocol
(SSL3, TLS1, TLS1., TLS1. or ALL)
-n :总共的请求执行数,缺省是1;
-c: 并发数,缺省是1;
-t:测试所进行的总时间,秒为单位,缺省50000s
-p:POST时的数据文件
-w: 以HTML表的格式输出结果
以下为执行 ab -n 5000 -c 200 http://localhost/test.php 的结果:
Benchmarking localhost (be patient)
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Completed requests
Finished requests //执行完的请求次数
Server Software: Apache/2.4.3 //apache版本
Server Hostname: localhost //主机
Server Port: 80 //端口 Document Path: /test.php //路径
Document Length: bytes Concurrency Level:
Time taken for tests: 3.927 seconds //完成此次请求时间
Complete requests: 5000 //完成请求次数
Failed requests: 527 //失败的请求次数
(Connect: , Receive: , Length: , Exceptions: )
Total transferred: bytes //总共传输字节
HTML transferred: bytes
Requests per second: 1273.33 [#/sec] (mean) //每秒请求次数
Time per request: 157.069 [ms] (mean) //一次请求时间
Time per request: 0.785 [ms] (mean, across all concurrent requests)
Transfer rate: 77914.14 [Kbytes/sec] received //传输速率 Connection Times (ms)
min mean[+/-sd] median max
Connect: 73.1
Processing: 143.9
Waiting: 135.3
Total: 160.3 Percentage of the requests served within a certain time (ms)
%
%
%
%
%
%
%
%
% (longest request)
ubuntu下 使用AB做压力测试的更多相关文章
- Linux学习13-CentOS安装ab做压力测试
前言 网站性能压力测试是服务器网站性能调优过程中必不可缺少的一,测试环境准备好了后,如何对网站做压力测试? 压力测试的工具很多,如:ab.http_load.webbench.siege.jmeter ...
- ab做压力测试
ab是apache 自带的一个压力测试的小工具,可用于接口简单的压力测试. 以下是AB的简要介绍 格式:ab [options] [http://]hostname[:port]/path 参数说明: ...
- centos8平台使用ab做压力测试
一,安装ab [root@blog ~]# yum install httpd-tools 说明:刘宏缔的架构森林是一个专注架构的博客,地址:https://www.cnblogs.com/archi ...
- ubuntu下用webbench做网站压力测试
安装依赖 exuberant-ctags sudo apt-get install exuberant-ctags 下载源码并安装 wget http://blog.s135.com/soft/lin ...
- 使用Apache Benchmark做压力测试遇上的5个常见问题
这一篇文章主要记录我在使用Apache Benchmark(一下检测ab)做网站压力测试的过程中,遇到的一些问题以及解决办法,方便日后使用. 这一篇文章主要记录我在使用Apache Benchmark ...
- Webbench、ab命令:做压力测试的工具和性能的监控工具
DDOS攻击:???DDOS概述:分布式拒绝服务(DDoS:Distributed Denial of Service)攻击,指借助于客户/服务器技术,将多个计算机联合起来作为攻击平台,对一个或多个目 ...
- 在linux中给你的应用做压力测试
在linux中给你的应用做压力测试 作者: 立地 邮箱: jarvin_g@126.com QQ: 511363759 一.webbench 1.在Ubuntu中安装webbench —支持get,h ...
- (转)学习使用Jmeter做压力测试(三)--数据库测试
数据库测试 JMeter可以做为Web服务器与浏览器之间的代理网关,以捕获浏览器的请求和Web服务器的响应,这样就可很容易的生成性能测试脚本. 根据脚本,JMeter可通过线程组来模拟真实用户对Web ...
- 使用JMeter做压力测试
使用JMeter做压力测试 1.下载Jmeter 地址:http://jmeter.apache.org/download_jmeter.cgi 2.启动jmeter 运行bin/jmeter.bat ...
随机推荐
- 深入JS系列学习4
深入JS系列学习4 Javascript 装载和执行 明白了JS的装载和执行,没有给出很好的解决方案,在IE下可用defer属性: 浏览器对于Javascript的运行有两大特性:1)载入后马上执行, ...
- Sql自动生成字母加数字的随机数
/* select char(65+ceiling(rand()*25)) --随机字母(大写) select char(97+ceiling(rand()*25)) --随机字母(小写) selec ...
- Java连接MySQL中文乱码处理【转载】
本文转载地址:http://developer.51cto.com/art/200906/130425.htm 感谢相关作者! MySQL默认编码是latin1 mysql> show vari ...
- C++类型转换[转]
转自 http://www.cnblogs.com/goodhacker/archive/2011/07/20/2111996.html C风格的强制类型转换(Type Cast)很简单,不管什么类型 ...
- 《SDN核心技术剖析和实战指南》3.3读书笔记
这一节主要是介绍几种开源的SDN控制器. NOX/POX.最初的NOX混合了C++和Python两种编程语言,现在演变为两个版本.NOX版本主要面向Linux平台,利用C++开发,目标是提供快速的控制 ...
- java中输入方式Scanner和BufferedReader
Scanner 在java.util包中,需要引入时可以用import java.util.*;或者import java.util.Scanner; 工作原理:通过new创建一个Scanner对象, ...
- django种表单post出现CSRF verification failed( CSRF验证失败 ) 的两种解决方式
现象 表单界面例如以下: watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvc29sbG9yNTI1/font/5a6L5L2T/fontsize/400/fi ...
- C#时间戳的获取与转换方法
/// <summary> /// 获取当前时间戳 /// </summary> /// <param name="bflag"></pa ...
- javascript加载图片获取图片尺寸信息方法
如果你遇到不方便从服务器取图片尺寸信息的话,用下面代码就很方便了. // 更新: // 05.27: 1.保证回调执行顺序:error > ready > load:2.回调函数this指 ...
- Android(java)学习笔记249:ContentProvider使用之获得系统联系人信息01
1.系统联系人的数据库(3张最重要的表) (1)raw_contacts 联系人表 保存联系人的id contact_id (2)data 数据表 保存联系人的数据 ( ...