Linux下最好的CMS是Zope!- -| 回首页 | 2004年索引 | - -受不了啦!!太牛了!居然有一个PHP写的Web Server!!!!

基于内存的缓存可以提高速度2个数量级(About PHPCMS)- -

                                      

发信人: AntiMonopoly (反对垄断), 信区: PHP
标 题: 基于内存的缓存可以提高速度2个数量级(About PHPCMS)
发信站: 武汉白云黄鹤站 (2003年05月06日09:27:11 星期二), 站内信件

以下是我们团队的车东(现供职于搜房网)发给我的测试报告。
可怜他Cyrix 266的机器,:)
标题:性能测试试验:基于内存的缓存可以提高速度2个数量级
性能测试试验
phpMan.php是一个基于php的man page server,每个man page需要调用后台的man命令和很
多页面格式化工具,系统负载比较高,提供了Cache Friendly的URL,以下是针对同样的页
面的性能测试资料:
测试环境:Redhat 8 on Cyrix 266 / 192M Mem
测试程序:使用apache的ab(apache benchmark):
测试条件:请求50次,并发50个连接
测试项目:直接通过apache 1.3 (80端口) vs squid 2.5(8000端口:加速80端口)



测试1:无CACHE的80端口动态输出:
ab -n 100 -c 10
http://www.chedong.com:81/phpMan.php/man/kill/1
This is ApacheBench, Version 1.3d <$Revision: 1.58 $> apache-1.3
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2001 The Apache Group, http://www.apache.org/

Benchmarking localhost (be patient).....done
Server Software: Apache/1.3.23
Server Hostname: localhost
Server Port: 80

Document Path: /phpMan.php/man/kill/1
Document Length: 4655 bytes

Concurrency Level: 5
Time taken for tests: 63.164 seconds
Complete requests: 50
Failed requests: 0
Broken pipe errors: 0
Total transferred: 245900 bytes
HTML transferred: 232750 bytes
Requests per second: 0.79 [#/sec] (mean)
Time per request: 6316.40 [ms] (mean)
Time per request: 1263.28 [ms] (mean, across all concurrent requests)
Transfer rate: 3.89 [Kbytes/sec] received

Connnection Times (ms)
min mean[+/-sd] median max
Connect: 0 29 106.1 0 553
Processing: 2942 6016 1845.4 6227 10796
Waiting: 2941 5999 1850.7 6226 10795
Total: 2942 6045 1825.9 6227 10796

Percentage of the requests served within a certain time (ms)
50% 6227
66% 7069
75% 7190
80% 7474
90% 8195
95% 8898
98% 9721
99% 10796
100% 10796 (last request)

测试2:SQUID缓存输出
/home/apache/bin/ab -n50 -c5 "http://localhost:8000/phpMan.php/man/kill/1
This is ApacheBench, Version 1.3d <$Revision: 1.58 $> apache-1.3
Copyright (c) 1996 Adam Twiss, Zeus Technology Ltd, http://www.zeustech.net/
Copyright (c) 1998-2001 The Apache Group, http://www.apache.org/

Benchmarking localhost (be patient).....done
Server Software: Apache/1.3.23
Server Hostname: localhost
Server Port: 8000

Document Path: /phpMan.php/man/kill/1
Document Length: 4655 bytes

Concurrency Level: 5
Time taken for tests: 4.265 seconds
Complete requests: 50
Failed requests: 0
Broken pipe errors: 0
Total transferred: 248043 bytes
HTML transferred: 232750 bytes
Requests per second: 11.72 [#/sec] (mean)
Time per request: 426.50 [ms] (mean)
Time per request: 85.30 [ms] (mean, across all concurrent requests)
Transfer rate: 58.16 [Kbytes/sec] received

Connnection Times (ms)
min mean[+/-sd] median max
Connect: 0 1 9.5 0 68
Processing: 7 83 537.4 7 3808
Waiting: 5 81 529.1 6 3748
Total: 7 84 547.0 7 3876

Percentage of the requests served within a certain time (ms)
50% 7
66% 7
75% 7
80% 7
90% 7
95% 7
98% 8
99% 3876
100% 3876 (last request)

结论:No Cache / Cache = 6045 / 84 = 70
结论:对于可能被缓存请求的页面,服务器速度可以有2个数量级的提高,因为SQUID是把
缓存页面放在内存里的(因此几乎没有硬盘I/O操作)。

附:一个缓存本地80端口APACHE服务的SQUID配置文件:
visible_hostname www.chedong.com
cache_dir ufs /usr/local/squid/cache/ 100 16 256
cache_effective_user squid
cache_effective_group squid

http_port 8000

# forward incoming requests to localhost, port 80
httpd_accel_host 127.0.0.1
acl acceleratedHost dst 127.0.0.1/255.255.255.255
httpd_accel_port 80
acl acceleratedPort port 80
httpd_accel_with_proxy on
acl all src 0.0.0.0/0.0.0.0

#acl myNet src 10.0.0.0/255.255.255.0

# we also don't want requests for localhost passed on to a peer
always_direct allow acceleratedHost

# Allow requests when they are to the accelerated machine AND to the
# right port
http_access allow acceleratedHost acceleratedPort
http_access allow all




Che, Dong
http://www.chedong.com

- 作者: 覃健祥 2004年10月27日, 星期三 20:23 加入博采

Trackback

你可以使用这个链接引用该篇文章 http://publishblog.blogchina.com/blog/tb.b?diaryID=183579

回复

评论内容: