Using Zend Framework for highload projects(将 Zend Framework 用于高负载项目)
问题描述
Zend Framework 是一个很好的框架,但速度不是很快.您能否判断将 Zend Framework 用于高负载项目是否值得,例如,对于可能包含大约十或数千名用户的电子邮件营销服务?使用 Zend Framework 是否可以达到可接受的性能?有人有这样的经历吗?非常感谢.
就我所见,对 Zend Framework 性能的最终防御和性能优化建议来自 Padraic Brady:
PHP 框架基准:有趣但最终没用
特别要注意他关于性能优化的四项建议:
<块引用>不要使用 Zend_Application.虽然 Zend_App 非常适合在标准化结构中创建一致的复杂引导程序,但它对基线性能的影响也很大.更直接的引导程序(ZF 在 Zend_App 到来之前是典型的)要快得多,而且无需配置文件即可完成.
跳过使用 ViewRenderer 插件.如果没有 ViewRenderer,您需要手动配置 Zend_View 并向控制器添加 render() 调用.这实际上非常简单,而且速度相当快 - 速度从来都不是 ViewRenderer 遗传学的真正组成部分.
使用自动加载.从框架库中去除 require_once 调用,以便忽略不需要的文件.用一个不那么疯狂的自动加载器函数替换 Zend_Loader_Autoloader 的使用.事实上,祈祷 Zend_Loader 永远不会被使用——它执行了很多文件操作,迄今为止,我从未向我解释过这些操作具有任何价值.
预加载所有内容(Symfony 2 Preview 可以!).它会为您购买一些性能 cookie 并平衡速度基线.使用简单的预加载脚本并不难.
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.
For what I have seen, the definitive defense of Zend Framework performance and recommendations for performance optimization comes from Padraic Brady at:
PHP Framework Benchmarks: Entertaining But Ultimately Useless
In particular, note his four recommendations for performance optimization:
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.
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.
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.
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 用于高负载项目的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:将 Zend Framework 用于高负载项目
基础教程推荐
- PHP 类:全局变量作为类中的属性 2021-01-01
- Cron Jobs 调用带有变量的 PHP 脚本 2022-01-01
- PHP PDO MySQL 查询 LIKE ->多个关键词 2021-01-01
- 如何替换eregi() 2022-01-01
- YouTube API v3 点赞视频,但计数器不增加 2022-01-01
- 在PHP中根据W3C规范Unicode 2022-01-01
- 如何在 Laravel 中使用 React Router? 2022-01-01
- 学说 dbal querybuilder 作为准备好的语句 2022-01-01
- 如何在 Laravel 5.3 注册中添加动态下拉列表列? 2021-01-01
- 有什么方法可以用编码 UTF-8 而不是 Unicode 返回 PHP`json_encode`? 2021-01-01
