Php 5.5: Apc Vs Zendoptimizer+

Via Remi Collet’s blog:

Anybody here who knows something substantial? Or is this pure speculation on Remi’s part?

It’s not speculation:

Thanks for the link to the RFC. I entirely missed that. This is very interesting as APC hasn’t carried any code-level optimization capabilities since (I think) v3.0.13

For reference:

So, ZO+ made it into pecl and it looks like the aforementioned rfc caused another 5.5 alpha being tagged. Anyone tried it yet? It’s been in remi’s repos for some time now but I couldn’t bring myself to install it so far.

I’ve tried PECL for Windows build. Worked fine with Yii.

“Worked fine” as in “didn’t break stuff” or as in “worth considering for production?”

Didn’t break stuff. I haven’t seriously benchmarked it.

So, a year later I had a closer look at it. Lack of memory management and a partially enigmatic documentation were things that scared me a bit :rolleyes:

After some experimentation, I believe these settings would be best in production:







Thank you for the information.

The latest APC (3.1.15-dev) has introduced a new configuration parameter called enable_opcode_cache. And, it is set to false by default.

I didn’t notice the change for quite a period and my sites had been working without opcode cache till then. :-[

I don’t know why, but PHP 5.4.25 couldn’t run with APC opcode cache enabled in my environment. So I had to install Zend Opcode Cache.

Yeah, well. I had issues with PHP 5.5.9 and APC 3.1.15, so I bit the bullet and made the switch to opcache+APCu. This has been surprisingly hard: Despite Zend Optimizer being around for YEARS (I remember having used it back in 2005), there is an awfull lot of misinformation and outright FUD around this opcode cache.

Btw, I hardly noticed any difference between opcode being enabled or not with the default settings too. I suspect this is due to the unusually relaxed default settings, which might result into the actual optimizer negating the effects of the opcode cache. I’ll try to run some benchmarks as soon as I’ve got a bare-metal box freed.

The following might be the best documentation for OPCache:

I miss the one-stop solution of APC with its web interface.

sigh No, it’s not. The really useful parts are scattered all over the web. Just as an example: The optimizer part is hardly explained in the opcache book. I found out by sheer chance how to control that on SO.

So far, the best documentation is hidden in the source code itself :unsure:

There are quite usable webinterfaces for opcache (currently using this one). But none of them will allow you to control opcache and APCu at once, if that’s what you meant.

I see.

So here you are to compile the tips once again for us.

Like in the APC wiki article? Might eventually happen :)


As being coding functions before UAT I didn’t started cache optimization. I never used APC nor any yii cache functions and I’m asking myself if it’s a good idea to start with yii APCcache and APCu with opcache or if something will be released in yii for opcache php > 5.5? Or maybe is there another solution I could start with and which will be maintained in the future? I’ll only need to cache public search for big hits. No need load-balancing for now.

Release target date is set to October and my objective is to use new 5.5 functions (APC is dead, long live opcache!). Am I wrong?

Thanks in advance :)