zoukankan      html  css  js  c++  java
  • 【性能测试】使用ab做Http性能测试

    [[TOC]]


    Http性能测试工具

    ab(ApacheBench)

    • 安装:
    yum install httpd
    
    • 使用
    ab -n 20 -c 1 192.168.35.1:8988/fortest
    

    参数说明:

    -n: 总请求次数;
    -c: 并发请求数(默认为1)
    
    • 结果示例:
    [root@localhost ~]# ab -n 20 -c 1 192.168.35.1:8988/fortest
    This is ApacheBench, Version 2.3 <$Revision: 1430300 $>
    Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
    Licensed to The Apache Software Foundation, http://www.apache.org/
    
    Benchmarking 192.168.35.1 (be patient).....done
    
    
    Server Software:        
    Server Hostname:        192.168.35.1
    Server Port:            8988
    
    Document Path:          /fortest
    Document Length:        2 bytes
    
    Concurrency Level:      1
    Time taken for tests:   2.099 seconds  //总共耗费时间
    Complete requests:      20
    Failed requests:        0
    Write errors:           0
    Total transferred:      2420 bytes
    HTML transferred:       40 bytes
    Requests per second:    9.53 [#/sec] (mean)   //每秒处理请求数量
    Time per request:       104.968 [ms] (mean)   //每次并发消耗平均时间
    Time per request:       104.968 [ms] (mean, across all concurrent requests) //每次请求消耗平时时间
    Transfer rate:          1.13 [Kbytes/sec] received
    
    Connection Times (ms)
                  min  mean[+/-sd] median   max
    Connect:        0    1   1.9      0       9
    Processing:   101  104   3.3    103     114
    Waiting:      101  103   3.4    102     114
    Total:        102  105   3.8    103     114
    
    Percentage of the requests served within a certain time (ms)
      50%    103
      66%    104
      75%    107
      80%    108
      90%    112
      95%    114
      98%    114
      99%    114
     100%    114 (longest request)
    
    
  • 相关阅读:
    回调函数
    zoj 2104
    zoj 1760
    ppt 图的基本算法 dfs
    zoj 2110 Tempter of the Bone
    优先队列 priority_queue 55 nyist
    STL的队列和栈简单使用
    poj 2246 递归 zoj 1094
    nyist 8 set的应用
    bailian 2694
  • 原文地址:https://www.cnblogs.com/ssslinppp/p/8243196.html
Copyright © 2011-2022 走看看