一、简介

ab是apache自带的压力测试工具。ab非常实用,它不仅可以对apache服务器进行网站访问压力测试,也可以对或其它类型的服务器进行压力测试。比如nginx、tomcat、IIS等。

二、语法

Usage: ab [options] [http[s]://]hostname[:port]/path
Options are:
-n requests Number of requests to perform
-c concurrency Number of multiple requests to make
-t timelimit Seconds to max. wait for responses
-b windowsize Size of TCP send/receive buffer, in bytes #
-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 for POSTing, 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.
-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 (SSL2, SSL3, TLS1, or ALL)

三、实例

Apache ab命令的更多相关文章

  1. ubuntu中安装apache ab命令进行简单压力测试

    1.安装ab命令 写道 apt-get install apache2-utils 2.ab命令参数说明. 写道 Usage: ab [options] [http[s]://]hostname[:p ...

  2. ab命令作apache压力测试

    ab命令作apache压力测试 ./ab -c 100 -n 10000 http://127.0.0.1/index.php -c 100 即:每次并发100个 -n 10000 即: 共发送100 ...

  3. 使用apache的ab命令进行压测

    1. 背景:互联网发达的今天,大大小小的网站如雨后春笋,不断出现,但是想要做出一个网站很简单,但是想要做好一个网站,非常非常难,首先:网站做好之后的功能怎么样这都是次要的,主要的是你的网站能承受怎么样 ...

  4. 使用apache 的 ab命令压力测试nginx服务器

    nginx压力测试方法: #ab命令 #安装ab #Centos系统 yum install apr-util #Ubuntu系统 sudo apt-get install apache2-utils ...

  5. 压力测试相关之ab命令

    1. 短时压力测试工具 ab 命令(apache的工具) 关键指标: Requests per second:    98.52 [#/sec] (mean)      ###平均每秒的请求数 Tim ...

  6. apache ab测试命令详解

    这篇文章主要介绍了apache性能测试工具ab使用详解,需要的朋友可以参考下   网站性能压力测试是服务器网站性能调优过程中必不可缺少的一环.只有让服务器处在高压情况下,才能真正体现出软件.硬件等各种 ...

  7. apache ab压力测试

    今天提到压力测试,想起以前看到的ab,于是又重新查找了下资料,并记录了下. ab命令会创建很多的并发访问线程,模拟多个访问者同时对某一URL地址进行访问. 它的测试目标是基于URL的,因此,既可以用来 ...

  8. Web性能压力测试工具之Apache AB 详解

    下载安装地址: http://httpd.apache.org/download.cgi yum install httpd-tools http://www.apachelounge.com/dow ...

  9. 如何使用 Apache ab 以及 OneAPM 进行压力测试?

    下一个 release 准备小长假后就要 go-live ,所有的测试 case 都 cover 过了,但还未进行过压力测试,有点不放心,刚好过节期间家人都回家去了,假期终于可以抽点时间压测一把. A ...

随机推荐

  1. 剑指Offer面试题:8.二进制中1的个数

    一 题目:二进制中1的个数 题目:请实现一个整数,输出该数二进制表示中1的个数.例如把9表示成二进制是1001,有2位是1.因此如果输入9,该函数输出2. 二 可能引起死循环的解法 // 计算整数的二 ...

  2. 重温CLR(五)类型和成员基础

    类型的各种成员 类型可以定义以下种类的成员 1 常量 常量是指出数据值恒定不变的符号.这种符号使代码更易阅读和维护.常量总与类型管理,不与类型的实例管理.常量逻辑上总是静态成员. 2 字段 字段表示只 ...

  3. 《DSP using MATLAB》示例Example7.19

    代码: M = 33; alpha = (M-1)/2; Dw = 2*pi/M; l = 0:M-1; wl = Dw*l; %Hdr = [0, 0, 1, 1]; wdl = [0, 0.6, ...

  4. 【Swift】 - 函数(Functions)总结 - 比较 与 C# 的异同

    1.0 函数的定义与调用( Defining and Calling Functions ) 习惯了C#了语法,看到下面的这样定义输入参数实在感到非常别扭,func 有点 Javascript的感觉, ...

  5. thinkphp的select和find的区别(转)

    做普通PHP项目转thinkphp时,字段自动完整匹配,ajax时前台数据一直取不到,后发现是select和find返回数据集有差异,参考下面方法修改. $this->ajaxReturn($m ...

  6. bzoj 2259 [Oibh]新型计算机 ——最短路(建图)

    题目:https://www.lydsy.com/JudgeOnline/problem.php?id=2259 不是 n^2 条边!连那条边权为0的边之后,只要每个位置向它的前一个位置和后一个位置连 ...

  7. Indy发送邮件被kbas退掉

    用indy开发了发送邮件程序,通过126,sina等发送邮件可以发送出去,而通过tom,163则被退回,显示被 kbas系统退回.后来通过观察Foxmail的通讯过程,区别在foxmail发送EHLO ...

  8. 远程debug配置

    1. 第一步,debugconfig 2. 在启动文件中添加 Set JAVA_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,address=,server=y ...

  9. MySQL-事务的实现-redo

    MySQL中事务: 事务的实现:      ACID: 原子性(A : Atomicity) 一致性(C : consistency ) 隔离性(I : isolation) 持久性(D : dura ...

  10. Java-Runoob:Java 条件语句

    ylbtech-Java-Runoob:Java 条件语句 1.返回顶部 1. Java 条件语句 - if...else 一个 if 语句包含一个布尔表达式和一条或多条语句. 语法 if 语句的语法 ...