• 使用 ApacheBench 进行轻量级压力测试


    ApacheBench 是 Apache Http Server 附带的一个轻量级压力测试功能

    先下载一个Apache Http Server :http://httpd.apache.org/

    解压之后 进入 /bin 文件夹 

    ab -n 100 -c 10  http://www.abc.com

    -n代表请求数

    -c代表并发数

    输出:

    Server Software: Microsoft-IIS/7.5
    Server Hostname: www.abc.com
    Server Port: 80

    Document Path: /
    Document Length: 3677 bytes  请求返回的字节长度

    Concurrency Level: 10  并发数
    Time taken for tests: 45.686 seconds  压力测试总耗时
    Complete requests: 100  请求数
    Failed requests: 1  失败请求数
    (Connect: 1, Receive: 0, Length: 0, Exceptions: 0)
    Total transferred: 394300 bytes  本次测试一共传输的字节长度,包含http header的内容
    HTML transferred: 367700 bytes  本次测试一共传输的html的字节长度,不包含http header
    Requests per second: 2.19 [#/sec] (mean)  每秒请求数量,平均值
    Time per request: 4568.557 [ms] (mean)  用户请求的处理时间,平均值  (一个用户可以有多个请求)
    Time per request: 456.856 [ms] (mean, across all concurrent requests)  请求平均处理时间,平均值(非用户请求)
    Transfer rate: 8.43 [Kbytes/sec] received  每秒获取数据的字节数

    Connection Times (ms)
    min mean[+/-sd] median max
    Connect: 2 245 1102.4 5 8997
    Processing: 31 4078 6221.8 3036 21046
    Waiting: 6 2642 4873.6 39 21022
    Total: 35 4323 6250.1 3042 21052

    Percentage of the requests served within a certain time (ms)
    50% 3042  百分之50的请求在3042毫秒返回
    66% 3098
    75% 6083
    80% 6125
    90% 12042
    95% 21044
    98% 21051
    99% 21052
    100% 21052 (longest request)

  • 相关阅读:
    WBS概念
    Cognos 8体系结构:请求流程
    Cognos8.4安装配置指南
    Cognos 8体系结构:层级结构
    程序猿媛都偷偷深爱的九大习惯
    Cookie是存储在客户端上的一小段数据
    Web前端必须规避的8个误区
    WEB前端开发常用的优化技巧汇总
    微信小程序怎么开发(小程序开发文档)
    入门 IT 行业,该具备哪些技能?
  • 原文地址:https://www.cnblogs.com/mahatmasmile/p/5688628.html
Copyright © 2020-2023  润新知