XCache + memcached?

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?
 
Why not just use XCache by itself? It has a variable cache. :rolleyes:

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.
 
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.
 
Any examples for correct configuration?
I guess whatever in XF FAQ isn't enough.

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.
 
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:
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:
This is my config.php using Xcache (storing settings 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 = ""
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?
 
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?

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

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
 
Mine is set to 14 because I have access to 14 CPU cores
View attachment 49079

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

Hi,

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

I added XCache in my config.php, even in my vB config.php and that's weird.
 
Last edited:
It's telling you that there is nothing being added to the user cache. Are you using it to store sessions as well?
 
Yes, but I'm using a test area, so there are only 3-4 people who are using the system.

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?
 
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';
 
I get logged out from the system at rendom times (while I'm translating). Is tihs connected to cacheSessions?
 
I get logged out from the system at rendom times (while I'm translating). Is tihs connected to cacheSessions?

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