百度空间 | 百度首页 
 
查看文章
 
土了, 还有ab这种彪悍的东西
2009-08-19 22:06
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也没啥分析价值的。

类别:默认分类 | 浏览() | 评论 (4)
 
网友评论:
1
2009-08-20 00:51 | 回复
嗯 这东西好用 我现在利用校内某游戏bug刷钱就靠它
以前是运行几十个./curl URL & 来攻击,打数据更新的时间差(估计没用transaction),后来用了ab后性能明显提高了
 
2
2009-08-20 08:54 | 回复
我觉得 655654 这个revision很猛啊
xiaonei应用真是漏洞百出-。- ,难道对数据库有操作的页面还是用http GET的??还是我不知道其实ab可以用POST?

 
3
2009-08-20 16:13 | 回复
清一色的GET
不过ab应该可以用POST的吧 我记得哪个参数里可以设置的
 
4
2009-08-20 19:41 | 回复
oh 我发现了,有-p POST-file这个选项。
 
发表评论:
姓 名:
网址或邮箱: (选填)
内 容:
验证码: 请点击后输入四位验证码,字母不区分大小写
      

     

©2009 Baidu