2014年1月13日星期一

APC Xcache提高Drupal站点3倍速度

Drupal PHP性能优化实战

Executed 82 queries in 310.18 milliseconds. Queries taking longer than 5 ms and queries executed more than once, are highlighted. Page execution time was 1557.2 ms.
Executed 50 queries in 49.63 milliseconds. Queries taking longer than 5 ms and queries executed more than once, are highlighted. Page execution time was 741.25 ms.
Executed 91 queries in 213.35 milliseconds. Queries taking longer than 5 ms and queries executed more than once, are highlighted. Page execution time was 1218.71 ms.
Executed 81 queries in 196.3 milliseconds. Queries taking longer than 5 ms and queries executed more than once, are highlighted. Page execution time was 1053.41 ms.

打开devel模块查看运行时间,发现大部分时间不是在query上面而是在PHP运行时间。
于是在关于优化的会议中提出这个方案,因为eAccelerator已经很久没更新了,所以不考虑测试安装。

1台LAMP环境的虚拟机导出两台,分别安装APC环境,Xcache环境。
以下测试结果。


without APC & Xcache
 with APC
 with Xcache
Login Page
1.261 (s)
0.293 (s)
0.288 (s)
Home Page
14.58 (s)
4.388 (s)
4.573 (s)
Device Page
15.444 (s)
5.172 (s)
5.383 (s)
Add Hardware
30.419 (s)
8.654 (s)
8.996 (s)
Logout
7.061 (s)
1.42 (s)
1.74 (s)

从结果上看已经达到了3倍以上的速度,比我预期的3倍效果更好。
Drupal的PHP是很复杂并且冗余的,在Drupal上面使用OPCODE Cache是再好不过的。

没有评论:

发表评论

上海松善实业有限公司

    上海松善实业有限公司是一家集多品牌销售于一体的电线电缆骨干企业,公司成立于2016年。 公司拥有国内各大品牌:起帆、远东、上上、江南、胜华等。     主要产品有:高低压电力电缆、橡套电缆、控制电缆、架空绝缘电缆、塑胶电缆、电子计算机电缆、通讯电缆、...