我想弄清楚如何使用ApacheBench和基准我的网站。我安装了默认的站点项目(它是ASP.NET MVC,但如果你不是.NET的人,请不要停下来阅读)。有人能解释一下这些ApacheBench结果的含义吗?
我没有改变任何东西。添加新项目。将配置设置为RELEASE。无调试运行。 (所以它处于LIVE模式)。是的,这是与内置的网络服务器,而不是生产级IIS或Apache或其他。
所以这里的结果: -
C:\Temp>ab -n 1000 -c 1 http://localhost:50035/
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 localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Completed 1000 requests
Finished 1000 requests
Server Software: ASP.NET
Server Hostname: localhost
Server Port: 50035
Document Path: /
Document Length: 1204 bytes
Concurrency Level: 1
Time taken for tests: 2.371 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 1504000 bytes
HTML transferred: 1204000 bytes
Requests per second: 421.73 [#/sec] (mean)
Time per request: 2.371 [ms] (mean)
Time per request: 2.371 [ms] (mean, across all concurrent requests)
Transfer rate: 619.41 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 1.1 0 16
Processing: 0 2 5.5 0 16
Waiting: 0 2 5.1 0 16
Total: 0 2 5.6 0 16
Percentage of the requests served within a certain time (ms)
50% 0
66% 0
75% 0
80% 0
90% 16
95% 16
98% 16
99% 16
100% 16 (longest request)
C:\Temp>
现在,我不知道到底是什么我应该看。
首先,我在一秒钟之后请求数。因此,如果我们有要求处理300次/秒的要求,那么这是说它处理和每秒421平均需求?
其次,添加更多并发的原因是什么?如果,如果我在1个并发上有1000次点击,那么2个并发上的500个不同?是否要测试是否有阻止其他请求的代码?
最后,有什么重要的,我从结果中错过了,我应该注意到?
谢谢:)
干杯队友:)我没有数据库或中间层服务。它只是默认的标准ASP.NET MVC项目。我只是试图让我的头了解ApacheBench的工作方式,以及我如何使用它来进行一些真正的bencharking等:) – 2009-09-14 01:58:24