Apache Benchmark(ab) 一款由apache提供的压力测试软件
首先我们先安装 环境
sudo apt-get install apache2-utils
//使用 用法:ab [options][http[s]://]hostname[:port]/path // -n 请求数 -c 并发数 url 目标压测地址 ab -n100 -c10 //对百度进行 压力测试 This is ApacheBench, Version 2.3 <$Revision: 1528965 $> Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ Licensed to The Apache Software Foundation, http://www.apache.org/ Benchmarking www.baidu.com (be patient).....done Server Software: BWS/1.1 // 服务器 Server Hostname: www.baidu.com Server Port: 80 Document Path: / Document Length: 96792 bytes Concurrency Level: 10 Time taken for tests: 30.740 seconds Complete requests: 100 Failed requests: 90 (Connect: 0, Receive: 0, Length: 90, Exceptions: 0) Total transferred: 9777233 bytes HTML transferred: 9677750 bytes Requests per second: 3.25 [#/sec] (mean) //每秒钟的请求数 Time per request: 3074.004 [ms] (mean) //时间越短越好 Time per request: 307.400 [ms] (mean, across all concurrent requests) Transfer rate: 310.61 [Kbytes/sec] received Connection Times (ms) min mean[+/-sd] median max Connect: 21 31 7.1 30 52 Processing: 82 468 3057.2 123 30717 Waiting: 21 40 30.6 35 321 Total: 114 499 3056.3 157 30740 Percentage of the requests served within a certain time (ms) 50% 157 66% 172 75% 185 80% 218 90% 341 95% 520 98% 629 99% 30740 100% 30740 (longest request)
时间: 2024-12-29 06:49:54