ab压力测试

Posted cshaptx4869

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ab压力测试相关的知识,希望对你有一定的参考价值。

一、安装:

yum -y install httpd-tools

 

二、命令

# 每次同时发送100个请求,总共1000个请求

ab -n 1000 -c 100 

# ab -k -c 100 -n 10000 http://127.0.0.1:9501/
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 127.0.0.1 (be patient)
Completed 1000 requests
Completed 2000 requests
Completed 3000 requests
Completed 4000 requests
Completed 5000 requests
Completed 6000 requests
Completed 7000 requests
Completed 8000 requests
Completed 9000 requests
Completed 10000 requests
Finished 10000 requests


Server Software:        Hyperf
Server Hostname:        127.0.0.1
Server Port:            9501

Document Path:          /
Document Length:        42 bytes

Concurrency Level:      100
Time taken for tests:   0.624 seconds
Complete requests:      10000
Failed requests:        0
Write errors:           0
Keep-Alive requests:    10000
Total transferred:      1900000 bytes
html transferred:       420000 bytes
Requests per second:    16020.94 [#/sec] (mean)
Time per request:       6.242 [ms] (mean)
Time per request:       0.062 [ms] (mean, across all concurrent requests)
Transfer rate:          2972.64 [Kbytes/sec] received

Connection Times (ms)
              min  mean[+/-sd] median   max
Connect:        0    1   7.0      0     104
Processing:     0    5   4.0      4     108
Waiting:        0    5   3.8      4      37
Total:          0    6   8.4      4     127

Percentage of the requests served within a certain time (ms)
  50%      4
  66%      5
  75%      6
  80%      6
  90%     10
  95%     14
  98%     20
  99%     24
 100%    127 (longest request)

Server Software: 对方服务器网络软件和版本 比如nginx/1.8.1

Document Path:请求目录
Document Length:请求文件大小

Concurrency Level:并发量
Time taken for tests:总共花费时间
Complete requests:总共请求次数
Failed requests:请求失败次数
Total transferred:总共数据量
HTML transferred:总共html代码量
Requests per second:每秒完成的请求书 ----非常重要


参考:https://blog.csdn.net/feiwutudou/article/details/80334099

以上是关于ab压力测试的主要内容,如果未能解决你的问题,请参考以下文章

Apache ab并发负载压力测试

ab(Apache Bench)压力测试工具

如何往linux中安装ab压力测试环境

如何使用apache自带的ab做压力测试

Apache ab 压力并发测试工具

Apache ab 压力并发测试工具