Learn about Centmin Mod LEMP Stack today
Register Now

Xenforo APC or Memcache

Discussion in 'Forum software usage' started by KeVo, Jun 30, 2014.

  1. KeVo

    KeVo Active Member

    180
    71
    28
    May 28, 2014
    Ratings:
    +101
    Local Time:
    1:37 PM
    1.11.x
    10.1.18
    Hello guys, just wondering which one to use.


    I know there is APC and memcache installed with Centmin, which I'm waiting to add to the config file. Which I'd like to ask which one is probably better suited to my lone Xenforo install (VPS droplet as well). Would APC suffice? I was reading that APC is probably better suited in a single server environment over memcache? Just wanting to confirm this or get corrected before I do something I might regret. LOL
     
  2. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,671
    Local Time:
    4:37 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  3. KeVo

    KeVo Active Member

    180
    71
    28
    May 28, 2014
    Ratings:
    +101
    Local Time:
    1:37 PM
    1.11.x
    10.1.18
    Sorry to bother, would you mind telling me how this configuration looks to you? I read that APC would do its thing just being left out?

    Code:
    $config['cache']['enabled'] = true;
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_';
    
    $config['cache']['backend'] = 'Memcached';
    $config['cache']['backendOptions'] = array(
        'compression' => false,
        'servers' => array(
            array(
                'host' => '127.0.0.1',
                'port' => 11211,
            )
        )
    );
     
  4. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,671
    Local Time:
    4:37 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    I'm using Centmin Mod's provided libmemcached instead of Memcached backend and caching sessions too

    Code:
    $config['cache']['enabled'] = true;
    $config['cache']['cacheSessions'] = true;
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions'] = array(
    'caching' => true,
    'cache_id_prefix' => 'xf_',
    'automatic_serialization' => true,
    'lifetime' => 0
    );
    
    $config['cache']['backend'] = 'Libmemcached';
    
    $config['cache']['backendOptions'] = array(
    'servers' => array(
    array(
    'host' => '127.0.0.1',
    'port' => 11211,
    'persistent' => 'true',
    'weight' => 1
    )
    )
    );
     
  5. rdan

    rdan Well-Known Member

    5,439
    1,398
    113
    May 25, 2014
    Ratings:
    +2,187
    Local Time:
    2:37 AM
    Mainline
    10.2
    I think this is only valid for Memcached, not for Libmemcached as per Zend Doc.

    Why enable this? As it will make it slow your performance.
     
  6. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,671
    Local Time:
    4:37 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    thanks faster is better :D

    Code:
    $config['cache']['enabled'] = true;
    $config['cache']['cacheSessions'] = true;
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions'] = array(
    'caching' => true,
    'cache_id_prefix' => 'xf_',
    'automatic_serialization' => false,
    'lifetime' => 0
    );
    
    $config['cache']['backend'] = 'Libmemcached';
    
    $config['cache']['backendOptions'] = array(
    'servers' => array(
    array(
    'host' => '127.0.0.1',
    'port' => 11211,
    'weight' => 1
    )
    )
    );
     
  7. quicksalad

    quicksalad Member

    228
    13
    18
    May 31, 2015
    Ratings:
    +20
    Local Time:
    12:07 AM
    can I use this settings? I believe I have Zend Opcache as I'm using PHP 5.6. Just want to know how to correctly configure Zend OpCache for PHP opcode caching + Memcached for backend caching with Xenforo.
    Thanks
     
  8. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,671
    Local Time:
    4:37 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    yeah for Centmin Mod LEMP should be fine if you have PHP 5.6 + Zend Opcache as memcached php extension is installed by default
     
  9. KeVo

    KeVo Active Member

    180
    71
    28
    May 28, 2014
    Ratings:
    +101
    Local Time:
    1:37 PM
    1.11.x
    10.1.18
    I use these settings in my config.php file and they work just fine. Just keep an eye on your caches to make sure they don't run out of memory allocation.

    :)
     
  10. quicksalad

    quicksalad Member

    228
    13
    18
    May 31, 2015
    Ratings:
    +20
    Local Time:
    12:07 AM
    I've added this to my config and @KeVo said to make sure they don't run out of memory allocation. How do I know or monitor that I'm running out of memory allocation? Thanks
     
  11. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,671
    Local Time:
    4:37 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
  12. quicksalad

    quicksalad Member

    228
    13
    18
    May 31, 2015
    Ratings:
    +20
    Local Time:
    12:07 AM
    never know that I missed this during installation :) I'm on 1GB RAM, any suggestion how to properly allocate cache memsize?
     
  13. KeVo

    KeVo Active Member

    180
    71
    28
    May 28, 2014
    Ratings:
    +101
    Local Time:
    1:37 PM
    1.11.x
    10.1.18
    Centmin Mod comes with a default memory allocate of 8MB. That's a solid default for sites starting out. If your site has outgrown that (one of the signs is you and your members being forcefully logged out a lot), or is about to, follow the link that eva posted above. Just don't go overboard when increasing your memory allocate, with regards to your server being a total of 1GB, combined with the other installed server software. I recommend increases of 8MB each time.

    @eva2000, if I have said something incorrect, please correct me. I am only going by my own personal experiences and the last thing I want to do is give bad advice. :D
     
  14. quicksalad

    quicksalad Member

    228
    13
    18
    May 31, 2015
    Ratings:
    +20
    Local Time:
    12:07 AM
    @KeVo thanks for the tip mate, any idea where can I locate Zend Opcache stat page? I couldn't find it here /usr/local/nginx/html/${N}_opcache.php
     
  15. KeVo

    KeVo Active Member

    180
    71
    28
    May 28, 2014
    Ratings:
    +101
    Local Time:
    1:37 PM
    1.11.x
    10.1.18
    @eva2000, where does this information get copied to during the Centmin install? I have only ever seen the memcached location with user/pass posted at the end of each Centmin installation.
     
  16. eva2000

    eva2000 Administrator Staff Member

    53,488
    12,130
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +18,671
    Local Time:
    4:37 AM
    Nginx 1.27.x
    MariaDB 10.x/11.4+
    it should be at /usr/local/nginx/html/${N}_opcache.php however there maybe a bug for initial installs on .08 beta03 since switching to Zend Opcache default from APC Cache that the /usr/local/nginx/html/${N}_opcache.php isn't created initially. Will need to look into that.

    You can also manually create the file from copy within Centmin Mod zip/code at config/zendopcache/opcache.php or by trying to install zend opcache again via install menu option (not reinstall menu option)
     
  17. KeVo

    KeVo Active Member

    180
    71
    28
    May 28, 2014
    Ratings:
    +101
    Local Time:
    1:37 PM
    1.11.x
    10.1.18
    @quicksalad, I followed these steps myself and was able to get into the stats page for the Zend OPCache, so hopefully this should work for you as well. Just remember to do the INSTALL option instead of the Reinstall.
     
  18. quicksalad

    quicksalad Member

    228
    13
    18
    May 31, 2015
    Ratings:
    +20
    Local Time:
    12:07 AM
    thanks... install option created it for me :) This is not password protected right? password protect needed or not?
     
  19. KeVo

    KeVo Active Member

    180
    71
    28
    May 28, 2014
    Ratings:
    +101
    Local Time:
    1:37 PM
    1.11.x
    10.1.18
    It is password protected. The username should be "opadmin" minus quotations and the logs should have generated you a generated password.
     
  20. quicksalad

    quicksalad Member

    228
    13
    18
    May 31, 2015
    Ratings:
    +20
    Local Time:
    12:07 AM
    mine does not prompt a password :(