Apache ab 测试工具分析

10 篇文章 0 订阅
参 数简 要描 述
-nrequests
请求
Number of requests to perform
要执行的请求数量
-cconcurrency
并发
Number of multiple requests to make at a time
同一时间请求的数量
-ttimelimitSeconds to max. to spend on benchmarking This implies -n 50000
测试所进行的最大秒数。其内部隐含值是-n 50000,它可以使对服务器的测试限制在一个固定的总时间以内。默认时,没有时间限制。
-stimeoutSeconds to max. wait for each response Default is 30 seconds
-bwindowsizeSize of TCP send/receive buffer, in bytes
-BaddressAddress to bind to when making outgoing connections
-ppostfileFile containing data to POST. Remember also to set -T
包含了需要POST的数据的文件
-uputfileFile containing data to PUT. Remember also to set -T
-Tcontent-typeContent-type header to use for POST/PUT data, eg. ‘application/x-www-form-urlencoded’ Default is 'text/plain’
POST数据所使用的Content-type头信息。
-vverbosityHow much troubleshooting info to print
-wPrint out results in HTML tables
-iUse HEAD instead of GET
-xattributesString to insert as table attributes
-yattributesString to insert as tr attributes
-zattributesString to insert as td or th attributes
-CattributeAdd cookie, eg. ‘Apache=1234’. (repeatable)
-HattributeAdd Arbitrary header line, eg. ‘Accept-Encoding: gzip’ Inserted after all normal header lines. (repeatable)
-AattributeAdd Basic WWW Authentication, the attributes are a colon separated username and password.
-PattributeAdd Basic Proxy Authentication, the attributes are a colon separated username and password.
-Xproxy:portProxyserver and port number to use
-VPrint version number and exit
-kUse HTTP KeepAlive feature
-dDo not show percentiles served table.
-SDo not show confidence estimators and warnings.
-qDo not show progress when doing more than 150 requests
-lAccept variable document length (use this for dynamic pages)
-gfilenameOutput collected data to gnuplot format file.
-efilenameOutput CSV file with percentages served
-rDon’t exit on socket receive errors.
-mmethodMethod name
-hDisplay usage information (this message)
-IDisable TLS Server Name Indication (SNI) extension
-ZciphersuiteSpecify SSL/TLS cipher suite (See openssl ciphers)
-fprotocolpecify SSL/TLS protocol

$ ab -c 100 -n 1000 http://php.me/test/index.php

Server Software:        nginx/1.12.2               # web 服务器
Server Hostname:        php.me                     # 服务器域名
Server Port:            80                         # 服务器端口

Document Path:          /test/index.php            # 请求的文件路径
Document Length:        11 bytes                   # 请求文件返回数据的大小,不是文件本身的大小

Concurrency Level:      100                        # 并发数量
Time taken for tests:   0.023 seconds              # 测试花费的时间
Complete requests:      100                        # 完成的请求数,成功的请求数
Failed requests:        0                          # 失败的请求数
Total transferred:      17400 bytes                # 传输的总字节
HTML transferred:       1100 bytes                 # HTML 传输的字节
Requests per second:    4297.19 [#/sec] (mean)     # 每秒响应请求数量
Time per request:       23.271 [ms] (mean)         # 
Time per request:       0.233 [ms] (mean, across all concurrent requests)  #
Transfer rate:          730.19 [Kbytes/sec] received #

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        2    3   0.9      3       5
Processing:     2   11   4.4     13      17
Waiting:        2   11   4.4     13      17
Total:          7   14   3.6     16      19

Percentage of the requests served within a certain time (ms)
  50%     16                      # 平均时间
  66%     17
  75%     18
  80%     18
  90%     18
  95%     18
  98%     18
  99%     19
 100%     19 (longest request)   # 最大请求时间
 
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值