美文网首页
AB压力测试

AB压力测试

作者: MZ钟沐 | 来源:发表于2018-07-30 21:33 被阅读21次

简介:

ab的全称是ApacheBench,是Apache附带的一个小工具,专门用于HTTP Server的benchmark testing,可以同时模拟多个并发请求。

例:

ab -n 10 -c 10 http://www.baidu.com/ 这个命令的意思是启动ab,向www.baidu.com发送10个请求(-n 10) ,并每次发送10个请求(-c 10)

20180730213300.png

需关注:

  1. 大家最关心的指标之一,相当于LR中的每秒事务数,后面括号中的mean表示这是一个平均值
  2. 大家最关心的指标之二,相当于LR中的平均事务响应时间,后面括号中的mean表示这是一个平均值
  3. 平均每秒网络上的流量,可以帮助排除是否存在网络流量过大导致响应时间延长的问题
20180730213308.png

请求格式:

请求:
./ab [options] [http://]hostname[:port]/path

参数:

-n requests 在测试会话中所执行的请求个数。默认时,仅执行一个请求

-c concurrency 一次产生的请求个数 。默认是一次一个。

-t timelimit 测试所进行的最大秒数。其内部隐含值是-n 50000。它可以使对服务器的测试限制在一个固定的总时间以内。默认时,没有时间限制。
-p postfile 包含了需要POST的数据的文件

-T content-type POST数据所使用的Content-type头信息

-v verbosity 设置显示信息的详细程度 - 4或更大值会显示头信息, 3或更大值可以显示响应代码(404, 200等), 2或更大值可以显示警告和其他信息。 -V 显示版本号并退出。

-w 以HTML表的格式输出结果。默认时,它是白色背景的两列宽度的一张表。

-i 执行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 -C cookie-name=value 对请求附加一个Cookie:行。 其典型形式是name=value的一个参数对。此参数可以重复。

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

相关文章

  • apache压力测试

    ab压力测试工具 ab命令详解 ab压力测试 一、ab命令 ab工具 Apache服务器的性能测试工具,它可以测试...

  • AB压力测试

    简介: ab的全称是ApacheBench,是Apache附带的一个小工具,专门用于HTTP Server的ben...

  • ab压力测试

    一、ab安装与介绍 Apache Benchmark(简称ab) 是Apache安装包中自带的压力测试工具 ,简单...

  • ab压力测试

    压测工具:压力工具选择使用ApacheBench; 下载:http://www.apachelounge.com/...

  • ab压力测试

    安装好Apache 测试场景:模拟10个用户,对百度首页发起总共100次请求。 测试命令:ab -n 100 -c...

  • ab压力测试

    ab压力测试 理解: 作用: 原理: 下载: linux:yum install httpd 检查是否安装成功:a...

  • ab 压力测试

    使用ab 简单测试接口的请求响应时间 单独接口测试 curl用来用post请求,且有header及请求内容 ab ...

  • ab压力测试

    参数说明 1.模拟get请求 直接在url后面带参数即可 2.模拟post请求 在当前目录下创建一个文件post_...

  • ab压力测试

    官方文档[https://fang.readthedocs.io/zh_CN/latest/%E8%BF%90%E...

  • 测试工具AB的使用

    一、什么是ab ab是apache自带的压力测试工具。ab不仅可以对apache服务器进行网站访问压力测试,也可以...

网友评论

      本文标题:AB压力测试

      本文链接:https://www.haomeiwen.com/subject/efdfvftx.html