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

XF 1.1 Xenforo plus APC plus Memcache?

Claudio

Well-known member
#1
Few days ago I saw a thread talking about how amazing was the speed using both software (APC and Memcache).

I would like to implement this on my dedicate server, so I will appreciate if anybody can send me the link of the thread that has many explanations about this.
I only found 2 threads that were created to ask some things, not to share the experience, that one is the one I´m looking for.

Thanks!
 

Jake Bunce

XenForo moderator
Staff member
#2
This is pretty much it:

http://xenforo.com/help/cache/

It all goes in library/config.php. You start by adding the frontend stuff:

Code:
$config['cache']['enabled'] = true;
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions']['cache_id_prefix'] = 'xf_';
// $config['cache']['cacheSessions'] = true;
Then add a backend, which for APC is just:

Code:
$config['cache']['backend'] = 'Apc';
Or memcache:

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,
		)
	)
);
Note that this config.php stuff is for storing cached data from XenForo. In addition, APC functions as an opcode cache which speeds up execution of the PHP code, but that happens by virtue of having APC installed on your server and doesn't require any configuration in XF.
 

Naatan

Well-known member
#3
To be clear, this is far more trouble than it's worth unless you are running a very active site. Especially if you don't know much about memcache, APC or caching in general.
 

RobinHood

Well-known member
#6
How active should a site be before considering switching from from APC to something more advanced like memcache?

I'm guessing that's kind of a how long is a piece of string question because it will depend on your server specs too, but but for VPS or a basic dedicated server would you be looking at 100 concurrent users, 200, 500, 1,000, more?

Also if there's a lot of images being uploaded and viewed do they get cached as well as posts using standard APC options?
 

Jake Bunce

XenForo moderator
Staff member
#7
How active should a site be before considering switching from from APC to something more advanced like memcache?

I'm guessing that's kind of a how long is a piece of string question because it will depend on your server specs too, but but for VPS or a basic dedicated server would you be looking at 100 concurrent users, 200, 500, 1,000, more?

Also if there's a lot of images being uploaded and viewed do they get cached as well as posts using standard APC options?
Say 100 concurrent users.

APC (opcode cache) speeds up code execution. The memory cache that you setup in the config file stores the registry information (xf_data_registry table) as well as sessions if you enable it. Both caches can be used simultaneously if you want (opcode + memory cache).
 

RoldanLT

Well-known member
#10
I'm using Zend Opcache and Memcache, but only Memcache was declared on config.php.
Is it fine i f I have this enabled: $config['cache']['cacheSessions'] = true;
On config.php ?
 

Jake Bunce

XenForo moderator
Staff member
#11
I'm using Zend Opcache and Memcache, but only Memcache was declared on config.php.
Is it fine i f I have this enabled: $config['cache']['cacheSessions'] = true;
On config.php ?
Yes, you can enable that in the config.php file. Nothing you have described about your setup is a problem. An opcode cache is different than a memory cache. You can use both. Only the memory cache requires specification in the library/config.php file.