博客首页 注册 建议与交流 排行榜 加入友情链接
推荐 投诉 搜索: 帮助

LAMPER

2008年7月3号<细节决定成败>
garfield61.cublog.cn


APACHE VS LIGHTTPD 的简单AB测试
最近网站流量很大,上了三台机器做负载均衡。其中两台用的是LIG+PHP,PHP运行方式是FASTCGI,另外一台是APACHE+PHP,PHP做为APACHE的模块运行。
分别对LIG的一台机器和APACE的机器做了AB测试,结果如下:

aa.com:

Server Software:        Apache/2.0.59

Server Hostname:        aa.com

Server Port:            80

 

apache/bin/ab -n 500 -c 20 http://aa.com/index.php

最高负载:6.47

Concurrency Level:      20

Time taken for tests:   14.554885 seconds

Requests per second:    34.35 [#/sec] (mean)

Time per request:       582.195 [ms] (mean)

 

apache/bin/ab -n 500 -c 80 http://aa.com/index.php

最高负载:8.98

Concurrency Level:      100

Time taken for tests:   13.706984 seconds

Requests per second:    36.48 [#/sec] (mean)

Time per request:       2741.397 [ms] (mean)

 

apache/bin/ab -n 1000 -c 100 http://aa.com/index.php

最高负载:14.71

Concurrency Level:      100

Time taken for tests:   23.801175 seconds

Requests per second:    42.01 [#/sec] (mean)

Time per request:       2380.117 [ms] (mean)

 

bb.com:

Server Software:        lighttpd/1.4.10

Server Hostname:        bb.com

Server Port:            80

 

apache/bin/ab -n 500 -c 20 http://bb.com/index.php

最高负载:9.33

Concurrency Level:      20

Time taken for tests:   52.501670 seconds

Requests per second:    9.52 [#/sec] (mean)

Time per request:       2100.067 [ms] (mean)

 

apache/bin/ab -n 500 -c 100 http://bb.com/index.php

最高负载:7.90

Concurrency Level:      100

Time taken for tests:   33.543664 seconds

Requests per second:    14.91 [#/sec] (mean)

Time per request:       6708.733 [ms] (mean)

 

apache/bin/ab -n 500 -c 100 http://bb.com/index.phP

最高负载:10.34

Concurrency Level:      100

Time taken for tests:   58.727335 seconds

Requests per second:    17.03 [#/sec] (mean)

Time per request:       5872.734 [ms] (mean)

 

从测试结果可以看出来,APACHE的处理request速度基本上是LIG的2.5倍,不过从负载能看出来,消耗的系统资源比LIG要稍多一些。不过总体效果还是比LIG上跑PHP要好。

发表于: 2006-11-15 ,修改于: 2006-11-15 17:31,已浏览578次,有评论0条 推荐 投诉


网友评论

发表评论