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

XCache + memcached?

Discussion in 'General PHP and MySQL Discussions' started by Moshe1010, Jun 16, 2013.

  1. Moshe1010

    Moshe1010 Well-Known Member

    Just wondering if this combination makes sense. XCache gave me the best results with PHP 5.4 and Apache 2.4 (APC and ZO were tested). Any thoughts?
     
  2. Jeremy P

    Jeremy P Well-Known Member

    Why not just use XCache by itself? It has a variable cache. :rolleyes:
     
  3. Moshe1010

    Moshe1010 Well-Known Member

    I got the idea that XCache works as opcache and it would be better to add data cache, although I'm not sure how much benefit small/medium boards have from data cache.

    Would you recommend adding XCache to config.php or just leave it to run as is?

    Thanks.
     
  4. Jeremy P

    Jeremy P Well-Known Member

    XCache is both an opcache and a data cache.

    I'd recommend adding it to config.php if you've configured the data cache correctly.
     
    Moshe1010 likes this.
  5. digitalpoint

    digitalpoint Well-Known Member

    If you are not using a multiple web server setup, you don't need memcached (in fact it would be slower than using XCache's data store).
     
    MattW and Moshe1010 like this.
  6. Moshe1010

    Moshe1010 Well-Known Member

    Any examples for correct configuration?
    I guess whatever in XF FAQ isn't enough.
     
  7. Jeremy P

    Jeremy P Well-Known Member

    What's in the FAQ is enough for configuring XenForo to use XCache, but I'm talking about configuring XCache itself (through php.ini settings). Such configuration depends on your server specs, so I couldn't really say.

    I wouldn't want to anyways because I'm no expert.. more of a guess and check kind of person and it's no huge deal to me when something goes wrong on one of my own boxes.
     
  8. Moshe1010

    Moshe1010 Well-Known Member

    I don't care breaking things since its a managed VPS (full support).
    Specs:
    2 X Xeon E5 2650
    4GB RAM

    XCache in php.ini:

    Code:
    xcache.shm_scheme =        "mmap"
    xcache.size  =              512M
    xcache.count =                1
    xcache.slots =                8K
    xcache.ttl  =                0
    xcache.gc_interval =          0
    
    xcache.var_size  =            8M
    xcache.var_count =            1
    xcache.var_slots =            8K
    xcache.var_ttl  =            0
    xcache.var_maxttl  =          0
    xcache.var_gc_interval =    300
    xcache.var_namespace_mode =    0
    xcache.var_namespace =        ""
    xcache.readonly_protection = Off
    
    xcache.cacher =              On
    xcache.stat  =              On
    xcache.optimizer =          Off
    [xcache.coverager]
    
    xcache.coverager =          Off
    xcache.coverager_autostart =  On
    xcache.coveragedump_directory = ""
    I'm wondering if xcache.optimizer does anything since in version 2 that functions didn't work.

    That's what I have in config.php

    Code:
    $config['cache']['enabled'] = true;
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_';
    $config['cache']['backend'] = 'XCache';
    Not sure if I need to add cacheSessions to my config.php since I know there are some problems with users logging in with APC.
     
    Last edited: Jun 17, 2013
  9. MattW

    MattW Well-Known Member

    This is my config.php using Xcache (storing sessions as well)

    PHP:
    $config['cache']['enabled'] = true;
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_';
    $config['cache']['cacheSessions'] = true;
    $config['cache']['backend']='Xcache';
    and my Xcache settings (VPS with 8GB RAM)
    Code:
    extension = "xcache.so"
    xcache.admin.enable_auth = On
    xcache.admin.user = "USERNAME"
    xcache.admin.pass = "MD5PASSWORD"
    xcache.shm_scheme = "mmap"
    xcache.size  = 256M
    xcache.count = 14
    xcache.slots = 8K
    xcache.ttl  =  0
    xcache.gc_interval = 0
    xcache.var_size  = 32M
    xcache.var_count = 14
    xcache.var_slots = 1K
    xcache.var_ttl  = 0
    xcache.var_maxttl  = 0
    xcache.var_gc_interval = 300
    xcache.var_namespace_mode = 0
    xcache.var_namespace = ""
    xcache.readonly_protection = Off
    xcache.mmap_path = "/dev/zero"
    xcache.coredump_directory =  ""
    xcache.coredump_type = 0
    xcache.disable_on_crash = Off
    xcache.experimental = Off
    xcache.cacher = On
    xcache.stat  = On
    xcache.optimizer = Off
    xcache.coverager = Off
    xcache.coverager_autostart =  On
    xcache.coveragedump_directory = ""
     
    Last edited: Jun 17, 2013
    CyclingTribe and Moshe1010 like this.
  10. Moshe1010

    Moshe1010 Well-Known Member

    Thanks. We have everything the same except xcache.count, which is based on CPU cores as I know that. Is there a reason for 14? I was thinking raising it to 8, although I'm not sure.
    And xcache.var_size that is 32M at yours, why so big?
     
  11. MattW

    MattW Well-Known Member

    Mine is set to 14 because I have access to 14 CPU cores
    vps.PNG

    I also have my xcache.var_size at 32M because I have a few other sites (phpBB3) using it as well. It's only using 6M, but doesn't hurt to have 32M
     
    Moshe1010 likes this.
  12. Moshe1010

    Moshe1010 Well-Known Member

    Got it, thank you!
     
    MattW likes this.
  13. Moshe1010

    Moshe1010 Well-Known Member

    Hi,

    Do you have any idea what that means?
    XCache 3.0.3   Diagnosis.png

    I added XCache in my config.php, even in my vB config.php and that's weird.
     
    Last edited: Jun 20, 2013
  14. MattW

    MattW Well-Known Member

    It's telling you that there is nothing being added to the user cache. Are you using it to store sessions as well?
     
  15. Moshe1010

    Moshe1010 Well-Known Member

    Yes, but I'm using a test area, so there are only 3-4 people who are using the system.
     
  16. CyclingTribe

    CyclingTribe Well-Known Member

    I think the session data should still remain, even after the people have stopped posting (providing they don't logout) - so perhaps the session data is not caching as expected?
     
  17. Moshe1010

    Moshe1010 Well-Known Member

    I had a weird error that said I have no timezone in my php.ini
    When I add a timezone , then I get the error above. If I delete the timezone, then I get PHP Compile time error (couple lines above in the diagnosis), but the VAR cacher error goes away.

    This is my config.php, nothing special there:
    Code:
    $config['cache']['enabled'] = true;
    $config['cache']['frontend'] = 'Core';
    $config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_';
    $config['cache']['cacheSessions'] = true;
    $config['cache']['backend'] = 'xcache';
     
  18. Moshe1010

    Moshe1010 Well-Known Member

    By doing nothing. Go figure...
    XCache 3.0.3   Diagnosis.png

    Is there any benefit enabling Coredump Directory?
     
  19. Moshe1010

    Moshe1010 Well-Known Member

    I get logged out from the system at rendom times (while I'm translating). Is tihs connected to cacheSessions?
     
  20. MattW

    MattW Well-Known Member

    Probably. Is Apache restarting when you are getting logged out? Or, how are you running PHP (DSO/suPHP/FastCGI)?
     

Share This Page