`
marb
  • 浏览: 409938 次
  • 性别: Icon_minigender_1
  • 来自: 北京
社区版块
存档分类
最新评论

使用apache ab命令进行简单压力测试

阅读更多

1.安装ab命令

写道
apt-get install apache2-utils

2.ab命令参数说明.

写道
Usage: ab [options] [http[s]://]hostname[:port]/path
Options are:
//总的请求数 
-n requests Number of requests to perform宅 
//一次同时并发的请求数 总的请求数(n)=次数*一次并发数(c) 

-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)

3.运行 ab -n 100 -c 10 http://hikin.iteye.com/

 下面是对http://hikin.iteye.com/   进行着100次请求,10个请求同时并发 压力测试结果

写道
Server Software: lighttpd/1.4.20
Server Hostname: hikin.iteye.com
Server Port: 80
Document Path: /
Document Length: 2095 bytes
Concurrency Level: 10
//整个测试持续的时间 
Time taken for tests: 3.303 seconds
//完成的请求数量 
Complete requests: 100
Failed requests: 0
Write errors: 0
Total transferred: 235200 bytes
HTML transferred: 209500 bytes
//平均每秒处理30个请求 
Requests per second: 30.27 [#/sec] (mean)
//平均每个请求处理时间为330毫秒 注:这里将一次10个并发请求看成一个整体 
Time per request: 330.335 [ms] (mean)
//平均每个并发请求处理 时间 为33毫秒 
Time per request: 33.034 [ms] (mean, across all concurrent requests)
Transfer rate: 69.53 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 51 170 35.9 178 230
Processing: 60 153 64.5 121 263
Waiting: 55 148 64.4 115 258
Total: 235 322 59.9 299 437
Percentage of the requests served within a certain time (ms)
//在这100个请求中有50%在299毫秒内完成 
50% 299
//在这100个请求中有66%在312毫秒内完成 
66% 312
75% 383
80% 412
90% 431
95% 432
98% 436
99% 437
100% 437 (longest request)
分享到:
评论

相关推荐

    Apache ab并发负载压力测试实现方法

    Apache的ab命令模拟多线程并发请求,测试服务器负载压力,也可以测试nginx、lighthttp、IIS等其它Web服务器的压力

    使用Apache ab工具对Apache服务器进行简单的压力测试

    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 //...

    ab压力测试的安装、使用、破2万并发测试

    ab命令非常的实用,它不仅可以对Apache服务器进行压力测试,也可以对其它的WEB服务器进行压力测试。如:Nginx、Tomcat、IIS等 ab的原理 ab命令的原理 ab命令会创建多个并发访问线程,模拟多个访问者同时对某一URL...

    AB测试工具

    ab是一种用于测试Apache超文本传输协议(HTTP)服务器的工具。apache自带ab工具,可以测试 apache、IIs、tomcat、nginx等服务器 但是ab没有Jmeter、Loadrunner那样有各种场景设计、各种...可以简单的进行一些压力测试

    window10本地电脑使用Apache Bench简称(ab)工具进行web端网站测试

    使用Apache Bench工具进行网站压力测试 下载我们需要的测试工具(ab)到你的电脑中apache bench工具下载地址 将下好的压缩包放在你的任意磁盘中,并解压出压缩包里的,我是解压缩到了D盘中 使用window10命令行工具...

    apache性能测试工具ab使用详解

    ab非常实用,它不仅可以对apache服务器进行网站访问压力测试,也可以对或其它类型的服务器进行压力测试。比如nginx、tomcat、IIS等。 下面我们开始介绍有关ab命令的使用: 1、ab的原理 2、ab的安装 3、ab参数说明 4...

    apache ab工具页面压力测试返回结果含义解释

    ab是apache自带的一个很好用的压力测试工具,当安装完apache的时候,就可以在bin下面找到ab 参数说明及示例 我们可以模拟100个并发用户,对一个页面发送1000个请求 输入命令:ab -n1000 -c100 //www.jb51.net/ ...

    ab网站压力测试命令

    诸如微软的WAST,惠普的LoadRunner以及等等其他的,但这些软件学习起来还是需要花费些时间,在选择上实在头痛,后来在郭欣的那本《构建高性能WEB站点》上看到了他介绍的这款Apache自带的压力测试工具ab,十分喜爱,...

    微课程之5分钟学会压力测试(ab)

    Apache的ab命令可以模拟多线程并发请求,对服务器进行压力测试。 只需一个命令就能做压力测试,简单高效,在很多情况下可以替代roadrunner, jmeter。 本课程包括: centos7下ab安装方法、ab压力测试实战、压力测试...

    如何通过Apache Bench实现web压力测试

    ab又是一个命令行工具,对发起负载的本机要求很低,根据ab命令可以创建很多的并发访问线程,模拟多个访问者同时对某一URL地址进行访问,因此可以用来测试目标服务器的负载压力。总的来说ab工具小巧简单,上手学习较...

    几个linux服务器性能测试工具,服务器压力测试

    5、Apache ab 压力测试:ab的全称是ApacheBench,ab是Apache 附带的超文本传输协议(HTTP)的性能测试工具。 其设计意图是描绘当前所安装的Apache的执行性能,主要是显示你安装的Apache每秒可以处理多少个请求;

    apache-tomcat-ab工具

    apache-tomcat-ab工具,采用命令可查看请求压力测试。

    Web性能压力测试工具之ApacheBench详解

    Apache中有个自带的,名为ab的程序,可以对Apache或其它类型的服务器进行网站访问压力测试。  ApacheBench命令原理:  ab命令会创建很多的并发访问线程,模拟多个访问者同时对某一URL地址进行访问。它的测试...

    Apache Bench

    ApacheBench 是 Apache 服务器自带的一个web压力测试工具,简称ab。ab又是一个命令行工具,对发起负载的本机要求很低,根据ab命令可以创建很多的并发访问线程,模拟多个访问者同时对某一URL地址进行访问,因此可以...

    apache性能测试工具

    它的测试目标是基于URL的,因此,它既可以用来测试apache的负载压力,也可以测试nginx、lighthttp、tomcat、IIS等其它Web服务器的压力。  ab命令对发出负载的计算机要求很低,它既不会占用很高CPU,也不会占用很多...

    Apache benchmark V2.3

    shit + 右键, 打开命令行 命令:ab -n1000 -c100 http://localhost:12001/

    ApacheHaus分布式压力测试

    安装 Linux linux直接yum -y install httpd-tools,然后ab -V测试 Windows 1、查看80端口有没有被占用 netstat -ano | findstr...D:\apache24\bin>ab -c 200 -n 1000 http:nginx负载均衡/压力方法 6 、测试结果 研究re

Global site tag (gtag.js) - Google Analytics