Nexus Weblogging
ChinaonRails
You are here ChinaonRails > 网站 > 测试 > 网站性能测试工具 Httperf/ab

Caiwangqin


3.583%

disconnected
登录后回复主题 | 跳到回复(9)

网站性能测试工具 Httperf/ab

... by Caiwangqin ... 34 月 25 天前 ... 3278 次点击

httperf - An HTTP server performance tester


还有 AB, Apache 自带的工具,在Apache 安装目录下的 bin 目录下可以找到,使用方法:

Usage: ab [options] [http://]hostname[: port]/path

E.g.:

c:\>ab -c 10 -n 100 http://www.cai.p1ay.cn/
This is ApacheBench, Version 2.0.40-dev <$Revision: 1.146 $> apache-2.0
Copyright 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright 2006 The Apache Software Foundation, http://www.apache.org/

Benchmarking www.cai.p1ay.cn (be patient).....done


Server Software: Mongrel
Server Hostname: www.cai.p1ay.cn
Server Port: 80

Document Path: /
Document Length: 58469 bytes

Concurrency Level: 10
Time taken for tests: 276.656250 seconds
Complete requests: 100
Failed requests: 28
(Connect: 0, Length: 28, Exceptions: 0)
Write errors: 0
Total transferred: 5875260 bytes
HTML transferred: 5847460 bytes
Requests per second: 0.36 [#/sec] (mean)
Time per request: 27665.625 [ms] (mean)
Time per request: 2766.563 [ms] (mean, across all concurrent requests)
Transfer rate: 20.74 [Kbytes/sec] received

Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.0 0 0
Processing: 2625 26403 5240.8 26500 33234
Waiting: 2578 26354 5238.8 26453 33171
Total: 2625 26403 5240.8 26500 33234

Percentage of the requests served within a certain time (ms)
50% 26500
66% 27562
75% 29000
80% 30281
90% 31953
95% 33046
98% 33125
99% 33234
100% 33234 (longest request)


2 - 2007-10-23 18:08
Caiwangqin 楼主 深圳
几个网站的httperf测试结果,都是30个并发连接,可以看到 sina.com.cn 的 Request rate: 100.1 req/s (10.0 ms/req), 而 chinaonrails.updatelog.com 是 Request rate: 1.5 req/s (656.5 ms/req) :


server1:~# httperf --port 80 --server sina.com.cn --num-conns 30 --uri /
httperf --client=0/1 --server=sina.com.cn --port=80 --uri=/ --send-buffer=4096
--recv-buffer=16384 --num-conns=30 --num-calls=1
Maximum connect burst length: 1

Total: connections 30 requests 30 replies 30 test-duration 0.300 s

Connection rate: 100.1 conn/s (10.0 ms/conn, <=1 concurrent connections)
Connection time [ms]: min 8.7 avg 10.0 max 16.7 median 9.5 stddev 1.7
Connection time [ms]: connect 4.6
Connection length [replies/conn]: 1.000

Request rate: 100.1 req/s (10.0 ms/req)
Request size [B]: 62.0

Reply rate [replies/s]: min 0.0 avg 0.0 max 0.0 stddev 0.0 (0 samples)
Reply time [ms]: response 5.4 transfer 0.0
Reply size [B]: header 375.0 content 231.0 footer 0.0 (total 606.0)
Reply status: 1xx=0 2xx=0 3xx=30 4xx=0 5xx=0

CPU time [s]: user 0.12 system 0.18 (user 40.0% system 60.1% total 100.1%)
Net I/O: 65.3 KB/s (0.5*10^6 bps)

Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
You have new mail in /var/mail/root
server1:~# httperf --port 80 --server chinaonrails.updatelog.com --num-conns 30 --uri /
httperf --client=0/1 --server=chinaonrails.updatelog.com --port=80 --uri=/ --send-buffer=4096
--recv-buffer=16384 --num-conns=30 --num-calls=1
Maximum connect burst length: 1

Total: connections 30 requests 30 replies 30 test-duration 19.695 s

Connection rate: 1.5 conn/s (656.5 ms/conn, <=1 concurrent connections)
Connection time [ms]: min 590.7 avg 656.5 max 1549.1 median 628.5 stddev 169.2
Connection time [ms]: connect 308.9
Connection length [replies/conn]: 1.000

Request rate: 1.5 req/s (656.5 ms/req)
Request size [B]: 77.0

Reply rate [replies/s]: min 1.2 avg 1.5 max 1.8 stddev 0.3 (3 samples)
Reply time [ms]: response 347.6 transfer 0.0
Reply size [B]: header 223.0 content 79.0 footer 0.0 (total 302.0)
Reply status: 1xx=0 2xx=30 3xx=0 4xx=0 5xx=0

CPU time [s]: user 8.00 system 10.30 (user 40.6% system 52.3% total 92.9%)
Net I/O: 0.6 KB/s (0.0*10^6 bps)

Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
server1:~# httperf --port 80 --server www.trikr.com --num-conns 30 --uri /
httperf --client=0/1 --server=www.trikr.com --port=80 --uri=/ --send-buffer=4096
--recv-buffer=16384 --num-conns=30 --num-calls=1
Maximum connect burst length: 1

Total: connections 30 requests 30 replies 30 test-duration 5.684 s

Connection rate: 5.3 conn/s (189.5 ms/conn, <=1 concurrent connections)
Connection time [ms]: min 159.5 avg 189.5 max 579.8 median 173.5 stddev 75.8
Connection time [ms]: connect 54.2
Connection length [replies/conn]: 1.000

Request rate: 5.3 req/s (189.5 ms/req)
Request size [B]: 64.0

Reply rate [replies/s]: min 5.0 avg 5.0 max 5.0 stddev 0.0 (1 samples)
Reply time [ms]: response 133.1 transfer 2.2
Reply size [B]: header 266.0 content 4182.0 footer 0.0 (total 4448.0)
Reply status: 1xx=0 2xx=30 3xx=0 4xx=0 5xx=0

CPU time [s]: user 2.40 system 2.87 (user 42.2% system 50.5% total 92.8%)
Net I/O: 23.3 KB/s (0.2*10^6 bps)

Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
server1:~# httperf --port 80 --server chinaonrails.com --num-conns 30 --uri /
httperf --client=0/1 --server=chinaonrails.com --port=80 --uri=/ --send-buffer=4096
--recv-buffer=16384 --num-conns=30 --num-calls=1
Maximum connect burst length: 1

Total: connections 30 requests 30 replies 30 test-duration 6.004 s

Connection rate: 5.0 conn/s (200.1 ms/conn, <=1 concurrent connections)
Connection time [ms]: min 151.9 avg 200.1 max 813.3 median 160.5 stddev 121.2
Connection time [ms]: connect 0.4
Connection length [replies/conn]: 1.000

Request rate: 5.0 req/s (200.1 ms/req)
Request size [B]: 67.0

Reply rate [replies/s]: min 4.5 avg 4.5 max 4.5 stddev 0.0 (1 samples)
Reply time [ms]: response 182.2 transfer 17.6
Reply size [B]: header 393.0 content 42945.0 footer 2.0 (total 43340.0)
Reply status: 1xx=0 2xx=30 3xx=0 4xx=0 5xx=0

CPU time [s]: user 2.17 system 2.64 (user 36.1% system 44.0% total 80.2%)
Net I/O: 211.8 KB/s (1.7*10^6 bps)

Errors: total 0 client-timo 0 socket-timo 0 connrefused 0 connreset 0
Errors: fd-unavail 0 addrunavail 0 ftab-full 0 other 0
3 - 2007-10-24 16:26
bd7lx 深圳
新浪与37信号公司的basecamp相比架构差异很大,应有负载均衡

还有一个Siege 老牌的压力/测试工具

http://www.joedog.org/JoeDog/Siege

开源测试工具:

http://www.opensourcetesting.org/performance.php

送个外卖:

31 个用来测试你网站各项性能的免费在线工具

http://zsk.akaka.com.cn/2007/06/31-free-tests-online/
5 - 2008-1-14 11:22
green 地球
just like chinaonrails for rails, any website/forum for performance testing specialists in China?

I need to hire someone to do some performance testing.

If you know any good one, please let me know through private message.
6 - 2008-1-17 12:54
bd7lx 深圳
http://rubyforge.org/projects/rwb

RWB, the Ruby Web Bench, a replacement for ab
这个有枯木逢春的迹象

http://on-ruby.blogspot.com/2008/01/rwb-reborn.html

http://www.red-bean.com/~pate/#Introduction

http://on-ruby.blogspot.com/2008/01/rwb-primer-from-2005.html
9 - 2009-6-9 8:05
bd7lx 深圳
Introducing Trample: A Better Load Simulator

压力测试
踏上几只脚
http://jamesgolick.com/2009/6/4/introducing-trample-a-better-load-simulator.html
看完之后有话想说?那就帮楼主加盖一层吧!

在回复之前你需要先进行登录
电子邮件或昵称
密码
当前热门主题  野心勃勃的用“饭桶”来部署git ... 34 篇回复
© 2006-2010 A Jesse Cai Production   -   About   -   京ICP备07020911号
a site powered by Project Babel