Should I enable OpCache in production? Any benchmark for php 7.0?

心不动则不痛 提交于 2019-12-08 12:55:27

问题


Should I enable OpCache in production? Any benchmark for php 7.0? Is there any benchmark that tells how much a Laravel application on a PHP 7.0 server can benefit from enabling and tuning opcache? It would also be nice to share your experience.


回答1:


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

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).

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.



来源:https://stackoverflow.com/questions/37773946/should-i-enable-opcache-in-production-any-benchmark-for-php-7-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!