且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

我应该在生产中启用OpCache吗? php 7.0是否有基准?

更新时间:2023-02-22 17:33:55

我已在生产环境中启用了opcache,并且没有任何问题.无疑有性能上的改进,所以我建议启用它.

I have opcache enabled in production and have had no problems. There is undoubtedly a performance improvement so I would recommend enabling it.

我不是Laravel开发人员,但是那里有很多性能比较.例如,快速的Google搜索显示 https://kinsta.com/blog/the-definitive-php-7-final-version-hhvm-benchmark/,其中具有Laravel(带有和不带有opcache)基准以及基于Laravel的产品(OctoberCMS,PyroCMS,Flarum)

I'm not a Laravel developer, however there's a bunch of performance comparisons out there. For example, a quick Google search reveals https://kinsta.com/blog/the-definitive-php-7-final-version-hhvm-benchmark/ which has a Laravel (with and without opcache) benchmark as well as Laravel based products (OctoberCMS, PyroCMS, Flarum).

虽然没有明确的基准,但值得一看 https://www.techempower.com/benchmarks/#section=data-r12&hw=peak&test=fortune&l=13yebk (适用于PHP框架基准测试). opcache尚未经过特别测试,但是HHVM可以使您大致了解性能改进的情况.

While there's no definitive benchmark, it's worth looking at https://www.techempower.com/benchmarks/#section=data-r12&hw=peak&test=fortune&l=13yebk for PHP framework benchmarks. opcache is not specifically tested, but HHVM is which should give you a rough idea of performance improvement.