将Zend Framework用于高负荷项目 [英] Using Zend Framework for highload projects

查看:65
本文介绍了将Zend Framework用于高负荷项目的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Zend Framework是一个很好的框架,但速度不是很快. 您能否说出使用Zend Framework进行高负荷项目是否值得,例如,用于可以吸引大约10,000或数十万用户的电子邮件营销服务? 使用Zend Framework是否有可能达到可接受的性能? 有人有这样的经验吗? 非常感谢.

Zend Framework is a good framework but not very fast. Can you tell whether it's worth using Zend Framework for highload projects, for example, for email marketing service that can inlude about ten or houndred thousand of users? Is it possible to achive acceptable performance using Zend Framework? Has anybody such an expirience? Thank you very much.

推荐答案

对于我所看到的,Zend Framework性能的明确防御和性能优化建议来自Padraic Brady,位于:

For what I have seen, the definitive defense of Zend Framework performance and recommendations for performance optimization comes from Padraic Brady at:

PHP框架基准测试:娱乐但最终没用

尤其要注意他关于性能优化的四个建议:

In particular, note his four recommendations for performance optimization:

  1. 不要使用Zend_Application.虽然Zend_App非常适合在标准化结构中创建一致的复杂引导程序,但它对基线性能的影响并不显着.更直接的引导程序(在Zend_App到来之前通常是ZF的引导程序)要快得多,并且也可以在没有配置文件的情况下完成.

  1. Don't use Zend_Application. While Zend_App is great for creating consistent complex bootstraps within a standardised structure, it doesn't come without a significant performance hit to baseline performance. A more direct bootstrap (typical of ZF until Zend_App arrived) is far faster and can also be done without configuration files.

使用ViewRenderer插件跳过.如果没有ViewRenderer,则需要手动配置Zend_View并向控制器添加render()调用.这实际上非常简单并且相当快-快速从未真正成为ViewRenderer遗传学的一部分.

Skip using the ViewRenderer plugin. Without the ViewRenderer, you need to manually configure Zend_View and add render() calls to Controllers. This is actually very simple to do and is fairly fast - fast was never really part of the ViewRenderer's genetics.

使用自动加载.从框架库中剥离require_once调用,以便忽略不需要的文件.将Zend_Loader_Autoloader的用法替换为不太疯狂的autoloader函数.实际上,从未使用Zend_Loader祈祷-到目前为止,它所做的很多文件操作对我来说都没有任何价值.

Use autoloading. Strip require_once calls from the framework library so unneeded files are ignored. Replace uses of Zend_Loader_Autoloader with a not-so-crazy autoloader function. In fact, pray Zend_Loader is never used - it does a lot of file ops that, to date, have never been explained to me as having any value.

预装所有内容(Symfony 2 Preview可以!).它为您购买了一些性能cookie,并均衡了速度基准.使用简单的预加载脚本并不难.

Preload everything (Symfony 2 Preview does!). It buys you some performance cookies and equalises the speed baseline. Using a simple preload script is not that hard.

这篇关于将Zend Framework用于高负荷项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆