Page MenuHomePhabricator

Improve support for PHP setups that use Zend OPCache
Closed, DuplicatePublic

Description

Zend OPCache is now open-source and more accessible since it compiles with PHP 5.5 by default and Linux package managers are providing packages like "php-opcache". It reportedly performs better than APC with regard to code caching.

The main downside to OPCache is that it doesn't expose user-level store/fetch functions for libraries like PhutilKeyValueCacheAPC. Until that gap is filled, I suspect a reasonable solution is to install both OPCache and APC, and disable the latter's code caching with apc.cache_by_default = 0 (maybe) or a blanket apc.filters rule. Currently the Phabricator docs don't mention OPCache at all.

Also, this OPCache + APC setup might work around the APC 3.1.14-15 segfaults although that's purely a guess with fingers crossed.

Event Timeline

ide raised the priority of this task from to Needs Triage.
ide updated the task description. (Show Details)
ide added a project: Phabricator.
ide added a subscriber: ide.

Until that gap is filled

There is a PECL package called APCu that contains just the APC user cache. OPCache + APCu is the upgrade path Fedora has taken for APC with PHP 5.5, so I think that's a reasonable expectation.

Phabricator works fine with no problems or setup issues with this combination.

I made a brief pass at OPCache + APCu (or something like it, I'm not 100% sure that was the package name, although it sounds familiar) the last time I switched machines and didn't have much luck (although I didn't try particularly hard), so my general stance here has been "wait for a standard user cache solution to emerge, and then recommend it". We may need to deal with this sooner than such a solution emerges, though.

I think I also had trouble building XHProf against 5.5.

The whole cache situation is kind of a trainwreck so I'm hoping it just goes away one day, but if that day doesn't come soon we can write a couple of pages of documentation about OPCache vs APC vs APCu and hopefully that will tide things over until the magical future date when there is one reasonable way to do this.