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 ...
随机推荐
- java安全HTTPS工具类
import java.io.FileInputStream; import java.security.KeyStore; import java.security.SecureRandom; im ...
- mysql rr和rc区别
<pre name="code" class="html">1. 数据库事务ACID特性 数据库事务的4个特性: 原子性(Atomic): 事务中的 ...
- latch:library cache
一:硬解析造成的shared pool latch 争用: 每一个sql被执行之前,先要到library cache中根据hash_value查找parent cursor,这就需要先获得librar ...
- 【HDOJ】1438 钥匙计数之一
状态压缩.分最后一个槽的值以及当前的配置方案是否可以进行DP. /* 1438 */ #include <cstdio> #include <cstring> #include ...
- POJ1008 1013 1207 2105 2499(全部水题)
做了一天水题,挑几个还算凑合的发上来. POJ1008 Maya Calendar 分析: #include <iostream> #include <cstdio> #inc ...
- 【转】带checkbox的ListView实现(二)——自定义Checkable控件的实现方法
原文网址:http://blog.csdn.net/harvic880925/article/details/40475367 前言:前一篇文章给大家展示了传统的Listview的写法,但有的时候我们 ...
- SET NOCOUNT (Transact-SQL)
阻止在结果集中返回显示受 Transact-SQL 语句或存储过程影响的行计数的消息. 语法 SET NOCOUNT { ON | OFF } 注释 当 SET NOCOUNT 为 ON 时,不返回 ...
- delphi 托盘程序 转
Delphi的托盘编程 .现在很多程序都用这个,比如傲游,迅雷等,主要代码如下: uses Windows, Messages, SysUtils, Variants, Classes, Grap ...
- LinGo:投资问题——线性规划
一.根据题目所给数据,建立一张表格方便查看 项目A 项目B 项目C 项目D 可投资年 1,2,3,4 3 2 1,2,3,4,5 收回本利年 次年年末 第5年 第5年 当年年末 本利 1.06 1.1 ...
- hihocoder1236(北京网络赛J):scores 分块+bitset
北京网络赛的题- -.当时没思路,听大神们说是分块+bitset,想了一下发现确实可做,就试了一下,T了好多次终于过了 题意: 初始有n个人,每个人有五种能力值,现在有q个查询,每次查询给五个数代表查 ...