$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;
$config['cache']['config'] = [
'servers' => [
['memcached.hostname.com', 11211, 33] // host, port, weight
// more servers
]
];
$config['cache']['provider'] = 'Memcached';
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;
$config['cache']['config'] = [
'server' => 'memcached.hostname.com'
];
$config['cache']['provider'] = 'Memcached';
What are configs to use multi forums on a same server with Memcached?PHP:$config['cache']['enabled'] = true; $config['cache']['sessions'] = true; $config['cache']['config'] = [ 'servers' => [ ['memcached.hostname.com', 11211, 33] // host, port, weight // more servers ] ]; $config['cache']['provider'] = 'Memcached';
If it's just a single server with default port and weight etc:
PHP:$config['cache']['enabled'] = true; $config['cache']['sessions'] = true; $config['cache']['config'] = [ 'server' => 'memcached.hostname.com' ]; $config['cache']['provider'] = 'Memcached';
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;
$config['cache']['config'] = [
'servers' => [
['memcached.hostname.com', 11212]
]
];
$config['cache']['provider'] = 'Memcached';
Memcached is listening on one port 11211, that requires to config memcached with multi ports?As far as I know the only way to separate memcached instances is to physically run separate instances on different ports, so you'd just use this approach:
So one forum would use port 11211. Another would use 11212 etc.PHP:$config['cache']['enabled'] = true; $config['cache']['sessions'] = true; $config['cache']['config'] = [ 'servers' => [ ['memcached.hostname.com', 11212] ] ]; $config['cache']['provider'] = 'Memcached';
Whoops, you posted this reply while I am typing the previous replyI think he just means different prefixes for different forums:
Code:$config['cache']['namespace'] = 'your_prefix';
Yes you need both, and memcached.hostname.com you can just substitute for the ip of where its hosted.
Please make sure you disable UDP and protect the memcached server outside connections: https://blog.cloudflare.com/memcrashed-major-amplification-attacks-from-port-11211/
It would definitely be helpful if the namespace setting was added to the Cache support page for easy referenceI think he just means different prefixes for different forums:
Code:$config['cache']['namespace'] = 'your_prefix';
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;
$config['cache']['config'] = [
'server' => 'memcached.hostname.com'
];
$config['cache']['provider'] = 'Memcached';
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'Memcached';
$config['cache']['config'] = [
'server' => '127.0.0.1'
];
$config['cache']['enabled'] = true;
$config['cache']['cacheSessions'] = true;
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions'] = array(
'caching' => true,
'cache_id_prefix' => 'xfxx_',
'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
)
)
);
$config['cache']['enabled'] = true;
$config['cache']['provider'] = 'Memcached';
$config['cache']['namespace'] = 'xfxx_';
$config['cache']['config'] = [
'server' => '127.0.0.1'
];
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;
$config['cache']['namespace'] = 'XXX_';
$config['cache']['config'] = [
'servers' => [
['localhost', 11211]
]
];
$config['cache']['provider'] = 'Memcached';
$config['cache']['enabled'] = true;
$config['cache']['frontend'] = 'Core';
$config['cache']['frontendOptions'] = array(
'caching' => true,
'automatic_serialization' => true,
'lifetime' => 1800,
'cache_id_prefix' => 'xxx_xf'
);
#backend
#Memcached
$config['cache']['backend']='Memcached';
$config['cache']['backendOptions']=array(
'compression'=>false,
'servers' => array(
array(
'host'=>'127.0.0.1',
'port'=>11211,
)
)
);
$config['cache']['cacheSessions'] = true;
$config['cache']['enabled'] = true;
$config['cache']['sessions'] = true;
$config['cache']['config'] = [
'server' => 'memcached.hostname.com'
];
$config['cache']['provider'] = 'Memcached';
This is what I'm running, and have been since converting to XF2
PHP:$config['cache']['enabled'] = true; $config['cache']['sessions'] = true; $config['cache']['namespace'] = 'XXX_'; $config['cache']['config'] = [ 'servers' => [ ['localhost', 11211] ] ]; $config['cache']['provider'] = 'Memcached';
Works perfectly for me (I assume I'd get errors if not, lol)! Thanks!This is what I'm running, and have been since converting to XF2
PHP:$config['cache']['enabled'] = true; $config['cache']['sessions'] = true; $config['cache']['namespace'] = 'XXX_'; $config['cache']['config'] = [ 'servers' => [ ['localhost', 11211] ] ]; $config['cache']['provider'] = 'Memcached';
We use essential cookies to make this site work, and optional cookies to enhance your experience.