Discover Centmin Mod today
Register Now

Xenforo APC or Memcache

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

  1. KeVo

    KeVo Active Member

    179
    70
    28
    May 28, 2014
    Ratings:
    +100
    Local Time:
    5:46 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

    30,956
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,418
    Local Time:
    9:46 AM
    Nginx 1.13.x
    MariaDB 5.5
    • Like Like x 1
  3. KeVo

    KeVo Active Member

    179
    70
    28
    May 28, 2014
    Ratings:
    +100
    Local Time:
    5:46 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

    30,956
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,418
    Local Time:
    9:46 AM
    Nginx 1.13.x
    MariaDB 5.5
    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
    )
    )
    );
     
    • Like Like x 3
  5. RoldanLT

    RoldanLT Well-Known Member

    3,978
    965
    113
    May 25, 2014
    Phillipines
    Ratings:
    +1,329
    Local Time:
    7:46 AM
    1.11
    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.
     
    • Informative Informative x 2
  6. eva2000

    eva2000 Administrator Staff Member

    30,956
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,418
    Local Time:
    9:46 AM
    Nginx 1.13.x
    MariaDB 5.5
    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
    )
    )
    );
     
    • Like Like x 3
  7. quicksalad

    quicksalad Member

    159
    9
    18
    May 31, 2015
    Ratings:
    +13
    Local Time:
    5:16 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

    30,956
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,418
    Local Time:
    9:46 AM
    Nginx 1.13.x
    MariaDB 5.5
    yeah for Centmin Mod LEMP should be fine if you have PHP 5.6 + Zend Opcache as memcached php extension is installed by default
     
    • Like Like x 1
  9. KeVo

    KeVo Active Member

    179
    70
    28
    May 28, 2014
    Ratings:
    +100
    Local Time:
    5:46 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.

    :)
     
    • Like Like x 1
  10. quicksalad

    quicksalad Member

    159
    9
    18
    May 31, 2015
    Ratings:
    +13
    Local Time:
    5:16 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

    30,956
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,418
    Local Time:
    9:46 AM
    Nginx 1.13.x
    MariaDB 5.5
    • Informative Informative x 1
  12. quicksalad

    quicksalad Member

    159
    9
    18
    May 31, 2015
    Ratings:
    +13
    Local Time:
    5:16 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

    179
    70
    28
    May 28, 2014
    Ratings:
    +100
    Local Time:
    5:46 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
     
    • Like Like x 1
    • Informative Informative x 1
  14. quicksalad

    quicksalad Member

    159
    9
    18
    May 31, 2015
    Ratings:
    +13
    Local Time:
    5:16 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

    179
    70
    28
    May 28, 2014
    Ratings:
    +100
    Local Time:
    5:46 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

    30,956
    6,917
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +10,418
    Local Time:
    9:46 AM
    Nginx 1.13.x
    MariaDB 5.5
    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)
     
    • Like Like x 1
    • Informative Informative x 1
  17. KeVo

    KeVo Active Member

    179
    70
    28
    May 28, 2014
    Ratings:
    +100
    Local Time:
    5:46 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.
     
    • Like Like x 1
  18. quicksalad

    quicksalad Member

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

    KeVo Active Member

    179
    70
    28
    May 28, 2014
    Ratings:
    +100
    Local Time:
    5:46 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

    159
    9
    18
    May 31, 2015
    Ratings:
    +13
    Local Time:
    5:16 AM
    mine does not prompt a password :(