ab的全称是 Apache HTTP server benchmarking tool。
ab is a tool for benchmarking your Apache Hypertext Transfer Protocol
(HTTP) server. It is designed to give you an impression of how your cur-
rent Apache installation performs. This especially shows you how many
requests per second your Apache installation is capable of serving.
注意OS X下的build不要用localhost, 而要直接用ip, 否则会报invalid argument
ab -c 100 -t 10 http://127.0.0.1/~Malic/
这里加的参数是保持100个连接的并行度并且持续10s的压力测试
现在是考验真家伙的时候了,Django自带的test server处理了几个请求就pipe error了,可能是用信号量实现的,信号的处理跟不上。贴上系统带的Apache的成绩,当然因为web server和ab都跑在同一个host上,如果能够分开两台机器比较公平。
杂:
前几天co了一个Webkit的Respository,进入目录svn log | less了一下,然后不小心G了一下,就如意料般的失去相应... 40000多的revision, 每次写个20行的change log. 80万行...
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 192.168.11.4 (be patient)
Finished 1123 requests
Server Software: Apache/2.2.11
Server Hostname: 192.168.11.4
Server Port: 80
Document Path: /~Malic/
Document Length: 358 bytes
Concurrency Level: 100
Time taken for tests: 10.246 seconds
Complete requests: 1123
Failed requests: 0
Write errors: 0
Non-2xx responses: 1157
Total transferred: 892047 bytes
HTML transferred: 414206 bytes
Requests per second: 109.60 [#/sec] (mean)
Time per request: 912.417 [ms] (mean)
Time per request: 9.124 [ms] (mean, across all concurrent requests)
Transfer rate: 85.02 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 47 107.5 1 515
Processing: 41 807 243.3 803 2419
Waiting: 24 776 240.2 778 2419
Total: 55 854 248.2 834 2420
Percentage of the requests served within a certain time (ms)
50% 834
66% 910
75% 989
80% 1051
90% 1134
95% 1305
98% 1421
99% 1597
100% 2420 (longest request)
跑ab跑多了记得清apache log,这样的log也没啥分析价值的。