ab服务器网页,使用ab进行web服务器压测详解

-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″。

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

-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

-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

-h Display usage information (this message)

参数很多,一般我们用-c和-n参数就可以了。例如:

ab -c 2 -n 10 www.51ste.com/

2f332263c99e154b0f5128740ad94c04.png

结果参数分析说明:

Document Path:测试页面

Document Length:页面大小

Concurrency Level:测试的并发数

Time taken for tests:整个测试持续的时间

Complete requests:完成的请求数量

Failed requests:失败的请求数量

Write errors: 0

Total transferred:整个过程中的网络传输量

HTML transferred:整个过程中的HTML内容传输量

Requests per second:最重要的指标之一,相当于LR中的每秒事务数,后面括号中的mean表示这是一个平均值

Time per request:最重要的指标之二,相当于LR中的平均事务响应时间,后面括号中的mean表示这是一个平均值

Time per request:每个连接请求实际运行时间的平均值

Transfer rate:平均每秒网络上的流量,可以帮助排除是否存在网络流量过大导致响应时间延长的问题

常见的一些坑

1)请求URL地址必须为指定格式[http://]hostname[:port]/path,如果hostname后面不带“/”,大家可以试试会发生什么?

本文由51ste.com网友编辑,未经授权,不得转载使用上述作品盈利;个人转载,需标明作者及出处。

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值