ab -c 500 -n 5000 http://jd.com/ # This is ApacheBench, Version 2.3 <$Revision: 1826891 $> # Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/ # Licensed to The Apache Software Foundation, http://www.apache.org/
# Concurrency Level: 500 #并发用户数,这是我们设置的参数之一 # Time taken for tests: 14.630 seconds #所有这些请求被处理完成所花费的总时间 单位秒 # Complete requests: 5000 #总请求数量,这是我们设置的参数之一 # Failed requests: 0 #表示失败的请求数量 # Non-2xx responses: 5000 # Total transferred: 1715000 bytes #所有请求的响应数据长度总和。包括每个HTTP响应数据的头信息和正文数据的长度 # HTML transferred: 825000 bytes #所有请求的响应数据中正文数据的总和,也就是减去了Total transferred中HTTP响应数据中的头信息的长度 # Requests per second: 341.75 [#/sec] (mean) #吞吐量,计算公式:Complete requests/Time taken for tests 总请求数/处理完成这些请求数所花费的时间 # Time per request: 1463.049 [ms] (mean) #用户平均请求等待时间,计算公式:Time token for tests/(Complete requests/Concurrency Level)。处理完成所有请求数所花费的时间/(总请求数/并发用户数) # Time per request: 2.926 [ms] (mean, across all concurrent requests) #服务器平均请求等待时间,计算公式:Time taken for tests/Complete requests,正好是吞吐率的倒数。也可以这么统计:Time per request/Concurrency Level # Transfer rate: 114.47 [Kbytes/sec] received #表示这些请求在单位时间内从服务器获取的数据长度,计算公式:Total trnasferred/ Time taken for tests,这个统计很好的说明服务器的处理能力达到极限时,其出口宽带的需求量。
# Connection Times (ms) #网络消耗时间, # min mean[+/-sd] median max # Connect: 9 242 414.5 138 3513 # Processing: 12 407 801.4 158 11468 # Waiting: 12 276 575.5 147 8130 # Total: 26 649 938.0 320 12727
# Percentage of the requests served within a certain time (ms) # 50% 320 #50%用户请求在320ms内返回 # 66% 359 #60%用户请求在359ms内返回 # 75% 858 # 80% 1009 # 90% 1431 #这是一个衡量点,主要参看指标 # 95% 2478 # 98% 3963 #98%用户请求在3963ms内返回 # 99% 4664 # 100% 12727 (longest request)
ab -c 10 -n 100 http://www.baidu.com/ This is ApacheBench, Version 2.3 <$Revision: 1826891 $> 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: 168409 bytes
Concurrency Level: 10 Time taken for tests: 4.660 seconds Complete requests: 100 Failed requests: 99 (Connect: 0, Receive: 0, Length: 99, Exceptions: 0) Total transferred: 16300978 bytes HTML transferred: 16182926 bytes Requests per second: 21.46 [#/sec] (mean) Time per request: 466.012 [ms] (mean) Time per request: 46.601 [ms] (mean, across all concurrent requests) Transfer rate: 3415.99 [Kbytes/sec] received
Connection Times (ms) min mean[+/-sd] median max Connect: 7 83 46.2 77 219 Processing: 134 371 76.3 383 775 Waiting: 7 91 40.2 87 205 Total: 141 454 72.9 455 826
Percentage of the requests served within a certain time (ms) 50% 455 66% 477 75% 488 80% 496 90% 509 95% 585 98% 654 99% 826 100% 826 (longest request)