博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
ab压力测试
阅读量:4634 次
发布时间:2019-06-09

本文共 1889 字,大约阅读时间需要 6 分钟。

ab的安装

1.源码安装apache

apache安装完毕后ab命令存放在apache安装目录的bin目录下。

2.yum安装apache

如果apache 是通过yum的RPM包方式安装的话,ab命令默认存放在/usr/bin目录下

3.没有安装apache直接安装ab

如果不想安装apache但是又想使用ab命令的话,我们可以直接安装apache的工具包httpd-tools

yum -y install httpd-tools

 

ab的使用

-c 表示 并发用户数

-n表示 总请求数

[root@cobbler bin]# ab -c3 -n30 https://10.207.200.100/main/index/index

This is ApacheBench, Version 2.3 <$Revision: 655654 $>
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Licensed to The Apache Software Foundation, http://www.apache.org/
Benchmarking 10.207.200.100 (be patient).....done
Server Software:        Apache/2.2.15
Server Hostname:        10.207.200.100
Server Port:            443
SSL/TLS Protocol:       TLSv1/SSLv3,ECDHE-RSA-AES256-GCM-SHA384,2048,256
Document Path:          /main/index/index
Document Length:        295 bytes
Concurrency Level:      3
Time taken for tests:   0.232 seconds
Complete requests:      30
Failed requests:        0
Write errors:           0
Non-2xx responses:      30
Total transferred:      14250 bytes
HTML transferred:       8850 bytes

Requests per second:    129.59 [#/sec] (mean)

Time per request:       23.150 [ms] (mean)
Time per request:       7.717 [ms] (mean, across all concurrent requests)
Transfer rate:          60.11 [Kbytes/sec] received
Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:       12   19   7.6     16      42
Processing:     0    2   2.4      1      10
Waiting:        0    1   1.0      1       5
Total:         12   21   8.9     17      52
Percentage of the requests served within a certain time (ms)
  50%     17                   #50%的请求在17S完成
  66%     21                   #66%的请求在21S完成
  75%     22
  80%     27
  90%     34
  95%     36
  98%     52
  99%     52
 100%     52 (longest request)

 

(1)Requests per second吞吐率

服务器并发处理能力的量化描述,单位是reqs/s,指的是在某个并发用户数下单位时间内处理的请求数。某个并发用户数下单位时间内能处理的最大请求数,称之为最大吞吐率。

计算公式:Complete requests/Time taken for tests

(2)Time per request用户平均请求等待时间

计算公式:Time token for tests/(Complete requests/Concurrency Level)。

(3)Time per requet(across all concurrent request)服务器平均请求等待时间

计算公式:Time taken for tests/Complete requests,正好是吞吐率的倒数。

转载于:https://www.cnblogs.com/sunshineyue/p/5082663.html

你可能感兴趣的文章
Linux安装postgresql
查看>>
MyBatis启动:MapperStatement创建
查看>>
Tomcat 调优及 JVM 参数优化
查看>>
【kindeditor】KindEditor获取多个textarea文本框的值并判断非空
查看>>
【 全干货 】5 分钟带你看懂 Docker !
查看>>
[转]优化Flash性能
查看>>
【大话设计模式】——浅谈设计模式基础
查看>>
popStar手机游戏机机对战程序
查看>>
hadoop2.4.1集群搭建
查看>>
Android采用Application总结一下
查看>>
ORA-00942:表或视图不存在(低级错误)
查看>>
Java Web项目结构
查看>>
PAT-1060 Are They Equal (科学计数法)
查看>>
lambda表达式树
查看>>
OpenCV YUV 与 RGB的互转(草稿)
查看>>
「Django」rest_framework学习系列-用户认证
查看>>
二次注入原理及防御
查看>>
要过一遍的博客列表
查看>>
栈和队列的操作
查看>>
会话记住已登录功能
查看>>