1. Please take a little time for this simple survey! Thank you for participating!
    Dismiss Notice
  2. Dear Pleskians, please read this carefully! New attachments and other rules Thank you!
    Dismiss Notice
  3. Dear Pleskians, I really hope that you will share your opinion in this Special topic for chatter about Plesk in the Clouds. Thank you!
    Dismiss Notice

Php 7 + Opcache + Nginx + W3 total cache

Discussion in 'Plesk 12.x for Linux' started by Xavier12, Feb 27, 2016.

  1. Xavier12

    Xavier12 Regular Pleskian

    16
    85%
    Joined:
    Oct 21, 2014
    Messages:
    264
    Likes Received:
    4
    Hey guys,

    We've enabled php 7 and opcache module, and using nginx.. but for some reason the opcache xcache option does not appear in w3 total cache. Using Centos 6.7

    Any advice?
     
    Last edited: Feb 27, 2016
  2. trialotto

    trialotto Golden Pleskian Plesk Guru

    37
     
    Joined:
    Sep 28, 2009
    Messages:
    1,445
    Likes Received:
    206
    @Xavier12,

    XCache does not really support PHP 7.

    The default opcache in PHP 7 is essentially an inherent Zend Extension, making any other opcache method rather unnecessary (and that is the simple way of putting it).

    By the way, you are using W3TC, implying that you are implicitly asking about a WP instance.

    For that reason, you have to be aware that

    - the WP instance should be of version 4.3 or later to gain full advantage of PHP 7,
    - using WP (4.4.2 for instance) with PHP 7 results in a huge performance increase, amongst other due to the fact that WP has native support for PHP 7 and the default opcache,
    - any other opcache can mitigate or even annihilate the improvement in performance,
    - W3TC has been written in the days of the PHP versions that actually did need some support for performance improvements: PHP 7 does not need that support,
    - W3TC is not really "PHP 7 ready",
    - W3TC is valuable for caching objects, databases and pages, but even that value decreases: use a combination of PHP 7 and Redis

    and so on.

    In short, I would strongly recommend to keep the Apache + Nginx + PHP 7 + FPM (server by Apache) as standard as possible and, optionally, add a Redis based cache.

    Regards.....
     
    Kingsley and Xavier12 like this.
  3. Xavier12

    Xavier12 Regular Pleskian

    16
    85%
    Joined:
    Oct 21, 2014
    Messages:
    264
    Likes Received:
    4
    Hi Trialotto,

    Thanks so much for the detailed response! Currently using memcached as well, do you think Redis should be used instead of memcached? Reason being is because we use cloudflare railgun.

    Please advise, thanks!
     
  4. trialotto

    trialotto Golden Pleskian Plesk Guru

    37
     
    Joined:
    Sep 28, 2009
    Messages:
    1,445
    Likes Received:
    206
    @Xavier12,

    Ehm, Railgun? Are you implying that you have a CloudFlare Business plan at $200 per month (or a lot less, if you purchased through specific partners)?

    To be honest, that is a lot of money for a ready-steady-configured Nginx server (what CloudFlare essentially is), whilst the alternative of Nginx Plus is also available.

    I am a bit suprised, in general but also from the perspective of your question.

    Any of the paid-for CloudFlare plans and certainly the Business plans would make a plugin like W3TC rather obsolete (and even "dangerous" in combination with CloudFlare).

    Moreover, the Railgun technique utilizes Memcached servers (read: managed by Cloudflare), which cannot be used in the W3TC setup.

    The whole Railgun idea is to use a "delta" (read: changes) based concept of delivering (in memory) cached content.

    In essence, there is no space for a local Memcached or Redis server, let alone a local Memcached server managed and used by the W3TC plugin.

    Even though the Railgun concept might seem impressive, a Redis cluster combined with a Nginx cluster, both with nodes across the world, will perform the same (and without the need for any delta based approach, making the whole system less error-prone).

    All of the above does more or less answer your question, but the answer is ambivalent: (on the one hand) you need a local memcached server to utilize the Railgun technology at it´s best and this local Memcached server is preferably not to be used or cannot be used for the W3TC plugin and (on the other hand) a Redis server can be used, to speed up a WP instance.

    I would strongly recommend to use the Redis cache approach with a WP instance, certainly if the site does not get that much visitors from other parts of the world (and even if it does, the use of a Redis cache will improve pageload speeds for those visitors. Note that one can use the (free) lightning fast CloudFlare DNS system to overcome any reduction in speeds for "foreign" visitors, but in most of the cases, this is not needed at all, since good implementations of Redis cache can allow pageload speeds of 3ms. Yes, dependent on the page: 3ms!)

    I also have to mention that a Redis based approach is more in line with "good practice": it has no use to optimize bad pages or sites with CDN techniques (i.e. the endresult still remains suboptimal), whilst it really does add value to improve the pages or sites and introduce some code that integrates caching into the page/site code (and this happens with Redis).

    In short, I am in favour of using Redis, certainly in the case of WP instance, even though that can be a challenge.

    Hope the above helps, if you have any questions, just start a personal conversation with me.

    Regards....
     
    Xavier12 likes this.
  5. Xavier12

    Xavier12 Regular Pleskian

    16
    85%
    Joined:
    Oct 21, 2014
    Messages:
    264
    Likes Received:
    4
    Hi Trialotto,

    Thanks for the complete breakdown.. makes a lot of sense. Yes, we are a Cloudflare partner and offer Railgun to our Wordpress customers. At this moment we already have memcached properly set up, otherwise railgun would not work.

    Will be setting up redis in that case, sounds like another great option. DM'ing you now. :)
     
Loading...