我想弄清楚如何使用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