2009-07-28 55 views
2

我一直在開發一個使用Django和MySQL的網站;我想知道的是我的服務器可以處理某些頁面的HTTP請求數量。什麼是在Linux上本地基準Apache的好方法?

我一直在使用圍攻,但我不確定這是否是一個很好的基準測試工具。

+0

這裏的「本地」是什麼意思?您希望基準測試工具與Apache運行在同一臺機器上? – innaM 2009-07-28 10:15:48

回答

4

ab,Apache的HTTP服務器基準測試工具。很多選擇。十個併發請求使用的一個例子:

 
% ab -n 20 -c 10 http://www.bortzmeyer.org/  
... 

Benchmarking www.bortzmeyer.org (be patient).....done 


Server Software:  Apache/2.2.9 
Server Hostname:  www.bortzmeyer.org 
Server Port:   80 

Document Path:  /
Document Length:  208025 bytes 

Concurrency Level:  10 
Time taken for tests: 9.535 seconds 
Complete requests:  20 
Failed requests:  0 
Write errors:   0 
Total transferred:  4557691 bytes 
HTML transferred:  4551113 bytes 
Requests per second: 2.10 [#/sec] (mean) 
Time per request:  4767.540 [ms] (mean) 
Time per request:  476.754 [ms] (mean, across all concurrent requests) 
Transfer rate:   466.79 [Kbytes/sec] received 

Connection Times (ms) 
       min mean[+/-sd] median max 
Connect:  22 107 254.6  24  854 
Processing: 996 3301 1837.9 3236 8139 
Waiting:  23 25 1.3  25  27 
Total:  1018 3408 1795.9 3269 8164 

Percentage of the requests served within a certain time (ms) 
    50% 3269 
    66% 4219 
... 

(在這種情況下,網絡延遲是主要的緩慢的因素。)

上訴機構報告自己在User-Agent字段,因此,日誌HTTP服務器的,你會看到類似的東西:

 
2001:660:3003:8::4:69 - - [28/Jul/2009:12:22:45 +0200] "GET/HTTP/1.0" 200 208025 "-" "ApacheBench/2.3" www.bortzmeyer.org 
3

ab是一種廣泛使用的基準測試工具,自帶的apache httpd的

2

Grinder很不錯。它可以讓您模擬來自多臺客戶機器的協調負載,這比單臺機器更有意義。

+0

從來沒有聽說過它,看起來很有前途+1 – dfa 2009-07-28 10:34:42

相關問題