PDA

View Full Version : Can I run Memcached for multi vB forums on a same server hosting?


Mattwhf
06-28-2016, 12:08 AM
I installed memcached on my hosting but it's running good for a forum.

When I activated memcached to enable for vB forums on a server then it worked incorrectly, then forums are using a same database from one forum hence I only can use memcached for 1 forum.

Here's codes that I enabled them in config.php for forums


$config['Datastore']['class'] = 'vB_Datastore_Memcached';
$i = 0;
// First Server
$i++;
$config['Misc']['memcacheserver'][$i] = '127.0.0.1';
$config['Misc']['memcacheport'][$i] = 11211;
$config['Misc']['memcachepersistent'][$i] = true;
$config['Misc']['memcacheweight'][$i] = 1;
$config['Misc']['memcachetimeout'][$i] = 1;
$config['Misc']['memcacheretry_interval'][$i] = 15;

How to fix this? should I change port or memcacheserver or something else?

Please advise.

Thanks

KevinL
06-28-2016, 01:07 AM
Use different prefixes Right above the lines you posted:

// ******** DATASTORE PREFIX ******
// If you are using a PHP Caching system (APC, XCache, eAccelerator) with more
// than one set of forums installed on your host, you *may* need to use a prefix
// so that they do not try to use the same variable within the cache.
// This works in a similar manner to the database table prefix.
// $config['Datastore']['prefix'] = '';

Mattwhf
06-28-2016, 02:18 AM
Thanks for your answer!

I can use whatever prefix I want, like this

$config['Datastore']['prefix'] = 'forum1';

and on forum 2, I can use

$config['Datastore']['prefix'] = 'forum2';

right?

and just curious, where can I see these prefix? in memcached or in databases?

KevinL
06-28-2016, 10:59 AM
I would put something after the prefix like _ You can install an admin page phpMemcachedAdmin. That should show you everything that is happening.

Mattwhf
07-01-2016, 12:25 PM
I would put something after the prefix like _ You can install an admin page phpMemcachedAdmin. That should show you everything that is happening.

Thanks KevinL, I could see memcached stats for my forum.

It's a great tool to use with user friendly interface. :)