WordPress.org

Ready to get started?Download WordPress

Forums

W3 Total Cache
[closed] Looking ahead to PHP 5.5... Zend Optimizer & the end of APC (23 posts)

  1. techsurgeons
    Member
    Posted 10 months ago #

    Looking ahead to PHP 5.5 and seeing that APC is pretty much a dead cache walking, will W3TC be able to use Zend Optimizer as a substitute for APC? Or should we prepare to switch over to a different Op Cache method?

    Thanks!

    http://wordpress.org/extend/plugins/w3-total-cache/

  2. Frederick Townes
    Member
    Plugin Author

    Posted 10 months ago #

    Have you done a bench test? Zend Optimizer has time and again not been proven any faster and APC is scheduled to be part of core PHP in the future.

  3. techsurgeons
    Member
    Posted 10 months ago #

    Hi Fredrick, thanks for the response.

    APC hasn't had a stable release since May 2011 and 3.1.4 had to be pulled for a nasty bug. Development on it is slower than a WP site not running W3TC. And APC is even less compatible with PHP 5.5 than it is with 5.4 - I traced the source of my 500 errors to APC with PHP 5.4.

    http://svn.php.net/viewvc/pecl/apc/trunk/?view=log

    Thanks!
    -J

  4. Frederick Townes
    Member
    Plugin Author

    Posted 10 months ago #

    That's fine, Zend will not be supported.

  5. kristofferR
    Member
    Posted 10 months ago #

    Eh Frederick, seems you are a bit confused.

    With the brand new PHP 5.5 branch, just released yesterday, Zend Optimizer+ is directly built in. This is pretty major, the first time an opcache has been a part of the core PHP package.

    APC is actually discontinued (it will never support PHP 5.5), and will never be integrated into the PHP core. I think integrating APC was the plan years ago, but they decided to go with Zend Optimizer+ instead since it was open sourced and determined to be a much better choice.

    I don't know what went wrong with your benchmarks, but Zend Optimizer+ has been shown to consistently be a little bit faster than APC. The PHP developer team aren't stupid, they chose Zend Optimizer+ for a reason.

    https://wiki.php.net/rfc/optimizerplus
    https://managewp.com/boost-wordpress-performance-zend-optimizer
    http://halfelf.org/2013/trading-apc-for-zend/

    To not support PHP 5.5/Zend Optimizer+ in W3CT would be a really weird and stupid decision. Sure, web hosts are incredibly slow in updating to the newest PHP versions, but deliberately not supporting an official feature of PHP 5.5 that can dramatically boost the performance of those lucky enough to have it, seems weird.

  6. silentdragonz
    Member
    Posted 10 months ago #

    It seems everyone is confused here. Zend Optimizer+ is purely an opcode cache. It does not support the same features APC did that this plugin took advantage of. Once you move on to PHP 5.5 Zend Optimizer+ will work out of the box without any troubles. The only support this plugin needs is to make the clear opcache button work which would be executing accelerator_reset(). The userdata cache in APC will be gone though. This is supposed to be a drop in replacement for usercache, https://github.com/krakjoe/apcu#readme, but I don't think it's considered stable yet.

    So in short he just needs to make the button work with it and we'll have essentially full support. It will be up to the users if they want to grab APCu to continue using those features or switch over to an alternative opcache with usercache support, disk caching, or memcached (redis support would be neat though).

  7. johnieB
    Member
    Posted 9 months ago #

    There is a heated debate here about Zend and APC. Everyone seams to understand it in their own way but perhaps this article will clear things up for all members http://www.ricardclau.com/2013/03/apc-vs-zend-optimizer-benchmarks-with-symfony2/.
    Things that you will find here also include a graphic representation of features. Also take a look at this post about Zend http://www.techyv.com/questions/zend-frame-work-last-version-auto-update.

  8. dfumagalli
    Member
    Posted 8 months ago #

    APC is actually discontinued (it will never support PHP 5.5)

    Here's a screenshot of APC working with PvP 5.5.

  9. Jesin A
    Member
    Posted 7 months ago #

    I arrived to this thread after facing a lot of problems with this opcache.

    Initially when I installed PHP-FPM 5.5 on my server, the wordpress admin panel was very fast (I didn't know it was the work of opcache) and I was very happy.

    But I was facing strange problems whenever I saved settings or posts. I had to submit it twice for the changes to be saved. First I thought it was due to APCu (yes as dfumagalli rightfully said APC is available via dotdeb repository. I installed it using "apt-get install php5-apcu") and checked the apc.stat setting (if this is set to 0 similar problems will occur) but it was set to 1 only.

    Then I thought it was something related to nginx but that too wasn't the case. Then after checking "modules loaded" by PHP I found it was due to opcache.

    So I disabled it only in the admin pages by adding the following code to "functions.php"

    if(is_admin()):
    ini_set("opcache.enable","0");
    endif;

    That solved the WordPress problem but I also had phpMyadmin installed. It started halting abruptly during delete queries.

    I sometimes had to double check through the mysql command-line if data was in fact deleted. So now I have commented out opcache.so module from loading and everything is back to normal.

    After all W3TC creates static pages so I don't need opcache :)

  10. dfumagalli
    Member
    Posted 7 months ago #

    Making Nginx + PHP (FPM) + APC work well is more of an art than technical skill. When you add memcached / redis and varnish and maybe a varying amount of available system memory, it gets even funnier.

    In particular, both NGinx and APC come with very conservative if not downright bad default settings. It's important to give APC and memcached enough room. The last (Xen) VPS I prepared, has Nginx in high availability configuration + PHP FPM + APC + memcached + varnish + MySQL 5.6 (in a master-slave setup) and it runs ISPConfig3, WP 3.6 with W3TC, a wiki and Magento 1.7 + another famous e-commerce software I am not authorized to disclose + phpmyadmin + awstats + squirrel mail and more. It works like a charm, including in the admins.
    Therefore if my configuration works, then yours should too.
    If it does not, I'd check the amount of memory given to APC as it seems to struggle dealing with demanding tasks like phpmyadmin and WP admin are. There is also a strong case for checking Nginx parameters as they command over PHP's ones and Nginx comes with absolutely insufficient defaults for enhanced, large web apps.

  11. novazembla
    Member
    Posted 6 months ago #

    hello,

    I have had the chance to test php-fpm 5.5 with it's new opcache and w3tc. All works fine but the opcache makes trouble as it caches the w3tc settings php files. Thus changes via the admin tool are not immediately visible which leads to confusion. Double saves and in my eyes sometimes even malfunctions. As opcache surely will be used more and more it might be good to use tweak your code to add opcache_invalidate(...) [http://www.php.net/manual/en/ref.opcache.php] for the affected scripts to make sure that the files are loaded new once the setting page's confirmation page is rendered.

    Many thanks for your work!

  12. dfumagalli
    Member
    Posted 6 months ago #

    For those who still want to augment PHP 5.5 it's possible to install APCu.
    It's a special version of APC that removed what's in common with the latest PHP internal cache (so, no conflicts) while keeping the features the PHP internal cache does not provide.

  13. Pothi
    Member
    Posted 6 months ago #

    +1 for APCu that stands for APC user cache. More info is available at https://github.com/krakjoe/apcu .

  14. alexblajan
    Member
    Posted 5 months ago #

    @Jesin A if you modify your OPCache configuration as follows you will see that it will work better.

    opcache.revalidate_freq=0
    opcache.consistency_checks=1

    I had yesterday the same problems with W3TC not saving files due to cache and I needed to do a "hard reset" of the browser to see the changes.
    Please confirm if its working.

    Thanks

  15. Jesin A
    Member
    Posted 5 months ago #

    @alexblajan I guess those settings slow down caching performance.

    From http://www.php.net/manual/en/opcache.configuration.php

    opcache.revalidate_freq integer

    How often to check script timestamps for updates, in seconds. 0 will result in OPcache checking for updates on every request.

    Now this means Opcache will check the script each time a request is made.

    opcache.consistency_checks integer

    If non-zero, OPcache will verify the cache checksum every N requests, where N is the value of this configuration directive. This should only be enabled when debugging, as it will impair performance.

  16. alexblajan
    Member
    Posted 5 months ago #

    @Jessin A well, its true but works for me. At the moment if I put those settings to normal, I have the same problem. Even if I want to save the W3TC settings.
    I noticed that sometimes curl and opcache have some problems.

  17. alexblajan
    Member
    Posted 5 months ago #

    so no real option ? If I activate OPcache on PHP5.5.3 my wordpress goes wrong, some pages are not showing up..
    don't know what to do :) everything is random

  18. WeeklyKorea
    Member
    Posted 5 months ago #

    Excuse me.. and sorry for my poor English.

    Zender is good and APC is also.

    And they can work properly with each other.

    I make and host some hompages. Normally, Zender + Opcache makes wordpress site faster but if well tuned, APC can do also very good performance.

    I use php 5.4.20 because 5.5+ uses new TCP/IP functions but most case, in the code optimization and speed viewpoint, 5.4x can be more efficent.

    And nowadays, PHP reached almost technical limit. And Zender is very good module but it is nonsence it include zender optimizer plus.

    As you well know, Zender optimizer plus is lower value module than Zender optimizer in many aspect.

    Anyway, if you make homepage with many CIs(wordpress, dupal..) and you should host other guests homepages, it is good to use zender and apc.

    You can avoid its confliction enough. Unlike eAccelerator, APC has good compatibility.

    Sorry for my poor English and I logged in this web for telling this.

  19. WeeklyKorea
    Member
    Posted 5 months ago #

    And

    W3 Total cache or WP SuperCache... <= this kind of plugins are nothing.

    Moreover, under well-tuned APM condition, they are only speed and cpu usage begger.
    Sometimes our customers install those kind of cache plug-ins and they don't feel its effect and it is natural. Because if you tune apache/php/mysql, those kind of cache plugins make only cpu high usage not speed up.

    And if you have own server and use Windows OS, you most tune the TCP/IP first. Windows is begger-like OS but very convenient. If you tune the TCP connection of Windows, it can make good speed as same speed as Unix(linux).

  20. Kisuka
    Member
    Posted 5 months ago #

    Please integrate opcache into W3 Total Cache. Opcache is built into PHP 5.5: http://us1.php.net/manual/en/intro.opcache.php

  21. TrogsWorld
    Member
    Posted 4 months ago #

    Want to confirm what alexblajan posted 3 weeks ago:

    "@Jesin A if you modify your OPCache configuration as follows you will see that it will work better.

    opcache.revalidate_freq=0
    opcache.consistency_checks=1"

    I have the same configuration, and have been experiencing the same problem with W3 and the OPcache (changes in W3 admin not showing up right away - as well as a MaxCDN error message that would not go away). Updated the setting with the two lines recommended, and problem resolved.

    Thanks for posting this alexblajan!

    I uninstalled and re-installed W3 twice thinking something was awry, but this was the problem.

  22. alexblajan
    Member
    Posted 1 month ago #

    @TrogsWorld sorry to answer so late. I'm happy that worked for you. Unfortunately I'm on a shared hosting with LiteSpeed and 5.5+/OPCache, and the guys from the hosting can't help me.
    It seems CloudLinux has a problem with that with shared hosting.

  23. esmi
    Theme Diva & Forum Moderator
    Posted 1 month ago #

    If you require assistance then, as per the Forum Welcome, please post your own topic.

    This 8 month old topic references an old version of WordPress.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic