我试图找到一种工具来对我的服务进行负载测试。目前,我已经使用了Apache Benchmark和Hey。
对于Apache Benchmark,命令为ab -k -c 50 -n 100 http://www.yahoo.com/
,结果如下:
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 21 21.4 39 47
Processing: 42 48 4.1 47 67
Waiting: 42 48 4.1 47 67
Total: 43 69 21.6 82 110
Percentage of the requests served within a certain time (ms)
50% 82
66% 87
75% 89
80% 91
90% 94
95% 97
98% 98
99% 110
100% 110 (longest request)
对于Hey,命令为hey -n 100 -c 50 -q 100 http://yahoo.com
,结果如下:
Summary:
Total: 2.5213 secs
Slowest: 1.5375 secs
Fastest: 0.4992 secs
Average: 1.0112 secs
Requests/sec: 39.6624
Latency distribution:
10% in 0.5225 secs
25% in 0.5645 secs
50% in 1.3194 secs
75% in 1.4125 secs
90% in 1.4432 secs
95% in 1.4590 secs
99% in 1.5375 secs
我使用了相同数量的请求和相同大小的并发请求。唯一的区别是request per second
设置为Hey。我想知道为什么Hey的结果的平均响应时间几乎比Apache Bench的结果大十倍?