2009-07-28 60 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

相关问题