用Zend Guard Loader,eAccelerator提升Apache2.2.19 + php5.3.x脚本执行速度

提升Apache2.2.19 + php5.3.6脚本执行速度

测试平台及硬件设备信息:Sys :CentOS 5.5 (x86_64)

CPU:Intel(R) Xeon(R) CPU E5620 @ 2.40GHz

Mem:MemTotal: 12289672 kB

Disk:300G *2 10k Raid 10

php脚本测试代码

<?php

$time_start = getmicrotime();

function getmicrotime(){

list($usec, $sec) = explode(” “,microtime());

return ((float)$usec + (float)$sec);

}

phpinfo();

$time_end = getmicrotime();

$time = $time_end – $time_start;

echo “Page execution time $time second!”;

?>

php脚本测试成绩:

测试一:apache2.2.19+php5.3.6

Page execution time 0.005138523101807 second!

测试二:apache2.2.19 + php5.3.6 + eAccelerator

Page execution time 0.0045059844970703 second!

测试三:apache2.2.19 + php5.3.6 + eAccelerator + Zend Guard Loader v5.5

Page execution time 0.0023508071899414 second!

测试四:apache2.2.19 +php5.3.6 + Zend Guard Loader v5.5

Page execution time 0.0022881031036377 second!

结果评比:

测试一:没有php加速器,脚本执行速度不理想。

测试二:加上eAccelerator后比测试一有速度提升,但还是不够快。

测试三:eAccelerator + Zend Guard Loader php脚本加速一倍而且很稳定。

测试四:php脚本加速非常明显而且很稳定,起伏在0.0023 0598上下

总结:线上服务器用采用测试三、测试四组合皆可,用php加速总比不用强很多。

注意:php5.3.x 配置Zend Optimizer 已经换成 Zend Guard Loader

zend guard loader 下载地址

http://downloads.zend.com/guard/5.5.0/ZendGuardLoader-php-5.3-linux-glibc23-x86_64.tar.gz

原创文章,作者:斑斓网站长,如若转载,请注明出处:https://www.argb.net/apache2-2-19-php5-3-x-with-zend-guard-loader-to-enhance-speed-of-script-execution.html

回复 字体

您的电子邮箱地址不会被公开。 必填项已用*标注

评论列表(1条)

  • 字体
    字体 2012 年 01 月 09 日 上午 8:48

    执行时,出现内部错误。。 哪里有问题?