文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>APACHE VS LIGHTTPD 的简单AB测试

APACHE VS LIGHTTPD 的简单AB测试

时间:2006-11-15  来源:garfield61

最近网站流量很大,上了三台机器做负载均衡。其中两台用的是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要好。

相关阅读 更多 +
排行榜 更多 +
漫云天气

漫云天气

生活实用 下载
奇点阅读源2025

奇点阅读源2025

系统软件 下载
千城聚合库

千城聚合库

系统软件 下载