Zend Framework 2:Composer \ Autoload \ includeFile速度很慢 [英] Zend Framework 2: Composer\Autoload\includeFile is slow

查看:59
本文介绍了Zend Framework 2:Composer \ Autoload \ includeFile速度很慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据New Relic事务跟踪器,有时Composer\Autoload\includeFile大约需要318毫秒来加载我的项目.

According to New Relic transaction tracer, sometimes Composer\Autoload\includeFile takes around 318 ms to load my project.

我已经从作曲家转储了一个类映射,但是仍然没有区别.

I have dumped a classmap from composer, but still no difference it made.

composer.json需要以下条件:

"require": {
        "php": ">=5.3.3",
        "zendframework/zendframework": "2.4.*",
        "zendframework/zendservice-amazon": "2.*",
        "wisembly/elephant.io": "~3.0",
        "knplabs/github-api": "~1.2"
    }

我的ZF2应用程序中只有一个模块.

I only have one module in my ZF2 application.

我的ZF2自动加载性能如何更快?

How can my ZF2 autoloading perform faster?

推荐答案

在New Relic中进行调试时,我们遇到了完全相同的问题.最后,我们将其追溯到文件系统,结果发现我们没有使用操作码缓存,这在高负载下可能会很痛苦.

We had the exact same issue while debugging in New Relic. Finally, we traced it to the filesystem, it turned out we weren't using opcode cache, which can be painful under high load.

检查您的操作码缓存,并尝试调整其内存设置.这就是我们设法解决的方法.

Check your opcode caching and try to tweak it's memory settings. That's how we managed to solve it.

这篇关于Zend Framework 2:Composer \ Autoload \ includeFile速度很慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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