【Apache】ab工具

格式:ab  [options]   [http://]hostname[:port]/path

-n requests Number of requests to perform
//在测试会话中所执行的请求个数(本次测试总共要访问页面的次数)。默认时,仅执行一个请求。
-c concurrency Number of multiple requests to make
//一次产生的请求个数(并发数)。默认是一次一个。
-t timelimit Seconds to max. wait for responses
//测试所进行的最大秒数。其内部隐含值是-n 50000。它可以使对服务器的测试限制在一个固定的总时间以内。默认时,没有时间限制。
-p postfile File containing data to POST
//包含了需要POST的数据的文件,文件格式如“p1=1&p2=2”.使用方法是 -p 111.txt 。 (配合-T)
-T content-type Content-type header for POSTing
//POST数据所使用的Content-type头信息,如 -T “application/x-www-form-urlencoded” 。 (配合-p)
-v verbosity How much troubleshooting info to print
//设置显示信息的详细程度 – 4或更大值会显示头信息, 3或更大值可以显示响应代码(404, 200等), 2或更大值可以显示警告和其他信息。 -V 显示版本号并退出。
-w Print out results in HTML tables
//以HTML表的格式输出结果。默认时,它是白色背景的两列宽度的一张表。
-i Use HEAD instead of GET
// 执行HEAD请求,而不是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. -C “c1=1234,c2=2,c3=3″ (repeatable)
//-C cookie-name=value 对请求附加一个Cookie:行。 其典型形式是name=value的一个参数对。此参数可以重复,用逗号分割。
提示:可以借助session实现原理传递 JSESSIONID参数, 实现保持会话的功能,如
-C ” c1=1234,c2=2,c3=3, JSESSIONID=FF056CD16DA9D71CB131C1D56F0319F8″ 。
-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.
//-P proxy-auth-username:password 对一个中转代理提供BASIC认证信任。用户名和密码由一个:隔开,并以base64编码形式发送。无论服务器是否需要(即, 是否发送了401认证需求代码),此字符串都会被发送。
-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
-h Display usage information (this message)
1 ab -n 2000 -c 300 -p kang.txt -T application/x-www-form-urlencoded -C ‘session="lfbb2pkp6i9iscivtodmsqmlo7"‘ http://live-rd.xuebadev.com/www/manage/pc/orderList
This is ApacheBench, Version 2.3
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/

Benchmarking 192.168.80.157 (be patient)
Completed 400 requests
Completed 800 requests
Completed 1200 requests
Completed 1600 requests
Completed 2000 requests
Completed 2400 requests
Completed 2800 requests
Completed 3200 requests
Completed 3600 requests
Completed 4000 requests
Finished 4000 requests

Server Software: Apache/2.2.15
Server Hostname: 192.168.80.157
Server Port: 80

Document Path: /phpinfo.php
#测试的页面
Document Length: 50797 bytes
#页面大小

Concurrency Level: 1000
#测试的并发数
Time taken for tests: 11.846 seconds
#整个测试持续的时间
Complete requests: 4000
#完成的请求数量
Failed requests: 0
#失败的请求数量
Write errors: 0
Total transferred: 204586997 bytes
#整个过程中的网络传输量
HTML transferred: 203479961 bytes
#整个过程中的HTML内容传输量
Requests per second: 337.67 [#/sec] (mean)
#最重要的指标之一,相当于LR中的每秒事务数,后面括号中的mean表示这是一个平均值
Time per request: 2961.449 [ms] (mean)
#最重要的指标之二,相当于LR中的平均事务响应时间,后面括号中的mean表示这是一个平均值
Time per request: 2.961 [ms] (mean, across all concurrent requests)
#每个连接请求实际运行时间的平均值
Transfer rate: 16866.07 [Kbytes/sec] received
#平均每秒网络上的流量,可以帮助排除是否存在网络流量过大导致响应时间延长的问题
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 483 1773.5 11 9052
Processing: 2 556 1459.1 255 11763
Waiting: 1 515 1459.8 220 11756
Total: 139 1039 2296.6 275 11843
#网络上消耗的时间的分解,各项数据的具体算法还不是很清楚

Percentage of the requests served within a certain time (ms)
50% 275
66% 298
75% 328
80% 373
90% 3260
95% 9075
98% 9267
99% 11713
100% 11843 (longest request)
#整个场景中所有请求的响应情况。在场景中每个请求都有一个响应时间,其中50%的用户响应时间小于275毫秒,66%的用户响应时间小于298毫秒,最大的响应时间小于11843毫秒。对于并发请求,cpu实际上并不是同时处理的,而是按照每个请求获得的时间片逐个轮转处理的,所以基本上第一个Time per request时间约等于第二个Time per request时间乘以并发请求数。
时间: 2024-08-09 23:53:53

【Apache】ab工具的相关文章

apache ab工具压力测试

apache本身自带了一个测试工具ab,在apache的安装目录bin目录下 ab的使用方法: Usage: ab [options] [http[s]://]hostname[:port]/path -n 测试会话中所执行的请求个数,默认时,仅执行一个请求-c 一次产生的请求个数.默认是一次一个-t 测试所进行的最大秒数-v 设置显示信息的详细程度 - 4或更大值会显示头信息, 3或更大值可以显示响应代码(404, 200等), 2或更大值可以显示警告和其他信息. -V 显示版本号zui 最常

apache ab工具对网站进行压力测试

Apache -- ab工具主要测试网站的(并发性能) 这个工具非常的强大. 基本语法 :   cmd>ab.exe –n 请求总次数  -c 并发数 请求页面的url    进入到ab.exe目录 举例:  cmd>ab.exe –n 10000 –c 100 http://localhost/test.php 简单test结果简单介绍一下:

Apache ab工具进行压力测试

Apache附带的ab工具(本机使用的PHP环境是WAMP集成环境,ab工具位于D:\wamp\bin\apache\Apache2.2.21 \bin)非常容易使用,ab可以直接在Web服务器本地发起测试请求,这至关重要,因为有些时候我们需要测试的仅仅是服务器的处理性能,并不想掺杂着网 络传输时间的影响.ab进行一切测试的本质都是基于HTTP的,所以可以说ab对于Web服务器软件的黑盒性能测试,获得的一切数据和计算结果,都是可以 通过HTTP来解释的. Apache附带的ab工具(本机使用的P

压力测试 apache ab工具使用说明

ab工具使用说明 1 . 安裝ab工具命令 sudo apt-get install apache2-utils 2.ab命令参数说明 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 timelimi

ab工具使用(测试平台的并发性能)简单介绍一下

Apache -- ab工具主要测试网站的(并发性能) 这个工具非常的强大. 基本语法 :   cmd>ab.exe –n 请求总次数  -c 并发数 请求页面的url    进入到ab.exe目录 举例:  cmd>ab.exe –n 10000 –c 100 http://localhost/test.php 简单test结果简单介绍一下: ab工具使用(测试平台的并发性能)简单介绍一下

apache 的ab 工具

ab是apache 进行http服务器压力测试的一个工具.用来衡量apache 服务器的执行效率,能够检测出apache每秒能够处理的请求数. 一个使用的例子如下(windows下) ab -n 100 -c 10 http://www.baidu.com/ 上面这个命令能够检测百度服务器的承压情况,其中-n 100表示总共发起100个连接请求,而-c 10表示同时维持10个并发.测试结果如下和字段的含义解释如下(飘黄是解释): This is ApacheBench, Version 2.3

三种压力测试工具 http_load 和 apache ab 、 siege 压力测试(转)

在测试站点性能时找到个不错的说明式文章 From:http://blog.csdn.net/lyflower/archive/2010/09/09/5873544.aspx 到http://www.acme.com/software/http_load/ 下载http_load ,安装也很简单直接make;make instlall 就行. http_load 的标准的两个例子是: http_load -parallel 5 -fetches 1000 urls.txt http_load -r

Apache ab测试工具使用方法(无参、get传参、post传参)(转)

转自Apache ab测试工具使用方法(无参.get传参.post传参) Ab测试工具是apache自带的测试工具,具有简单易上手的特性,下面我总结一下我的使用方法,首先去官方下载apache程序包,我下的最新版本apache2.4.23,下载地址http://httpd.apache.org/download.cgi 我下载的windows版本,解压后放到某一目录即可. 1.呼出控制台 可以使用系统自带cmd或者Xshell工具均可 2.进入apache下的bin目录ab.exe就在此处 3.

Apache ab 测试工具使用(一)

简述: 试用apache ab测试工具 下载点 http://httpd.apache.org/download.cgi 参考: http://jingyan.baidu.com/article/e3c78d647a57833c4c85f502.html ab的参数说明 -n  需要执行的请求次数 -c  并发的数量 -t   等待返回的最长时间 -b  TCP收发缓冲区的大小,单位(byte) -p 使用post (同时需要定义-T参数) -u 使用put (同时需要定义-T参数) -T co

开源性能测试工具Apache ab使用

Apache ab是著名的Web服务器软件Apache附带的一个小工具,它可以同时模拟多个并发请求,测试Apache等Web服务器的最大承载力. Apache ab基本用法是:AB [options] [http://]hostname[:port]/path,其中几个最常见的Options选项如下: -n:表示请求总数. -c:表示并发用户数,并发用户数不能大于请求总数,否则会报错. -URL:表示请求的目标URL. Apache ab实战: 用Apache ab来测试下金大叔的新浪博客首页h