Thursday, 18. June 2009, 10:45:36
JavaScript, Benchmark
看了一下
SlickSpeed,各大 JS 框架都已更新至今天最新发布版。
在自己的机器上用 Firefox 3.0.11 测试了一下,结果如图:
从这个结果来看,DOMAssistant 2.8 最强(65 ms),ExtJS Core 3.0 次之(260 ms),最差是 YUI 2.7.0(811 ms),最强和最差之间相差10倍还多!
DOMAssistant 我还没用过,看来得关注一下了。
Friday, 15. February 2008, 01:03:53
Apache, Test, ab, Benchmark
...
Apache 有一个自带的性能测试工具叫
ab (Apache Bench)。
用这个工具,只须指定同时连接数、请求数以及URL,即可测试网站或网站程序的性能。
通过
ab 命令发送请求之后,可以得到每秒传送字节数、每秒处理请求数、每请求处理时间等统计数据。
举个例子,要得到同时连接数为 100、请求数达 1000,访问
http://example.com/index.html 的性能测试数据,命令格式如下:
ab -n 1000 -c 100 http://example.com/index.html若目标地址需用户认证,可加
-A 参数。
ab 命令的常用参数:
-n 数值: 发起测试的请求数
-c 数值: 发起测试的同时连接数
-A 用户名:密码
需要注意的是,
ab 只是对单一文件的请求,访问对象带有图像文件等情况下,则要具体情况具体分析。
下面是
ab 命令具体运用的一个实例:
# ab -n 1000 -c 10 http://localhost/foo/cache/ This is ApacheBench, Version 2.0.40-dev <$Revision: 1.121.2.1 $> apache-2.0
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2002 The Apache Software Foundation, http://www.apache.org/
Benchmarking localhost (be patient)
Completed 100 requests
Completed 200 requests
Completed 300 requests
Completed 400 requests
Completed 500 requests
Completed 600 requests
Completed 700 requests
Completed 800 requests
Completed 900 requests
Finished 1000 requests
Server Software: Apache/2.0.46
Server Hostname: localhost
Server Port: 80
Document Path: /foo/cache/
Document Length: 26 bytes
Concurrency Level: 10
Time taken for tests: 11.986245 seconds
Complete requests: 1000
Failed requests: 0
Write errors: 0
Total transferred: 223000 bytes
HTML transferred: 26000 bytes
Requests per second: 83.43 [#/sec] (mean)
Time per request: 119.862 [ms] (mean)
Time per request: 11.986 [ms] (mean, across all concurrent requests)
Transfer rate: 18.10 [Kbytes/sec] received
Connection Times (ms)
min mean[+/-sd] median max
Connect: 0 0 0.8 0 26
Processing: 11 114 408.0 92 7412
Waiting: 0 74 317.4 34 4143
Total: 11 115 408.0 92 7412
Percentage of the requests served within a certain time (ms)
50% 92
66% 104
75% 104
80% 104
90% 106
95% 132
98% 332
99% 983
100% 7412 (longest request)