1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Zend opcache question

Discussion in 'Server Configuration and Hosting' started by clubpromos, Aug 10, 2015.

  1. clubpromos

    clubpromos Active Member

    Hi,

    I use PHP Version 5.6.12 and Zend Opcache is enabled.
    Is there anything specific that I need to add to my config.php file for Xenforo? (I thought not but now I have a doubt).

    All I have in my config.php is:
    Code:
    $config['cache']['enabled'] = true;
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_';
    Screenshot_1.png

    Am I missing something?

    Thanks
     
  2. teletubbi

    teletubbi Active Member

    For opcache not. In fact you need nothing in the config for opcache.
    Only if you use another cache mechanism like memcached.
     
    clubpromos likes this.
  3. clubpromos

    clubpromos Active Member

    Thanks for confirming that. I suddenly thought that I was missing something.
     
  4. HWS

    HWS Well-Known Member

    XenForo (Zend) cache options have nothing to do with Opcache.

    If you want to change the Zend cache from the default file cache to something else, you need to configure that in XenForo's config.php

    See:
    Defining a Cache | XenForo
     
  5. clubpromos

    clubpromos Active Member

    Ok, so Opcache works with PHP anyway.
    So if I want even better cache I need to use memcached or APC (not sure if that works with PHP5.6 and my configuration. That's what you mean?
     
  6. teletubbi

    teletubbi Active Member

    Memcached works with 5.6
     
  7. clubpromos

    clubpromos Active Member

    Should I expect significant improvements by adding memcached in your experience?
     
  8. teletubbi

    teletubbi Active Member

    I would say yes.
    Caching is always an advantage.
     
  9. Jattitude

    Jattitude Member

    Opcache with memcached will make your page loads very fast. Check the page loads on one of my sites (signature) and see if you like the speed. I also use nginx as a proxy to apache.
     
  10. Puntocom

    Puntocom Well-Known Member

    Sure. I recommend Opcache+Memcached, definitely you (and your server) will notice it.

    I get much better results with redis instead of memcached for wp sites but redis is not officially supported in XenForo.
     
  11. Puntocom

    Puntocom Well-Known Member

    At least in my setup I have to activate opcache in php.ini:
    Code:
    ; Determines if Zend OPCache is enabled
    opcache.enable=1
    
     
  12. clubpromos

    clubpromos Active Member

    Thanks all for your responses.
    Would someone be able to share how they have their memchached configured in config.php?
     
  13. jeffwidman

    jeffwidman Active Member

    Can you quantify that?

    Whenever I've benchmarked them, they're about equal, it's just redis was a lot more convenient to develop against because of all the extra data structures it supports.
     
  14. Solidus

    Solidus Well-Known Member

    Code:
    $config['cache']['backend'] = 'Memcached';
    $config['cache']['backendOptions'] = array(
        'compression' => false,
        'servers' => array(
            array(
                // your memcached server IP /address
                'host' => 'localhost',
               
                // memcached port
                'port' => 11211,
            )
        )
    );
     
  15. clubpromos

    clubpromos Active Member

    Thanks @Solidus , so just like that with the stock configuration from XF docs. Nice.
     
  16. Puntocom

    Puntocom Well-Known Member

    Just subjetive experience, I did not measure the performance scientifically. But it feels noticeably faster in my setup. Maybe the plugin affects this result (Redis object cache vs. Memcached is your friend). A good advantage of redis vs memcached is the persistence support, specially for small sites.
     
  17. clubpromos

    clubpromos Active Member

    I ended up with "An exception occurred: The memcache extension must be loaded for using this backend !"

    I think that it would have been much clearer if the documentation said that memcache (without 'd') MUST be installed and loaded too.


    I performed a quick test on server response time which I was hoping to improve a little bit but it turns out that it didn't help at all for response time to enable memcache (d).
     
    Last edited: Aug 15, 2015
  18. Solidus

    Solidus Well-Known Member

    Memcached helped more with page load times for me, no response times.
     
  19. clubpromos

    clubpromos Active Member

    I was about to add this. I think that there is an improvement in page loads yes, Not very much but it's there.
    I'm still trying to find a solution to the server response time (not using a cheap server).
     
  20. Puntocom

    Puntocom Well-Known Member

    Are you using nginx? I'd look into optimizing it along with php-fpm.

    This new web server looks promising: H2O
     

Share This Page