View Full Version : Datastore Cache functional yet?
Zero Tolerance
Thu 9th Jun '05, 7:06pm
Maybe i'm blind, but i can't find the option to change the datastore cache to filesystem instead of the database, i see the datastore cache php file in my includes/ directory, however all the variables are blank, so is it functional yet? And if so where would i find how to modify it.
Sorry if it's been answered already, i couldn't find anything using the search.
- Zero Tolerance
Andreas
Thu 9th Jun '05, 7:11pm
In config.php put
$config['Misc']['datastore'] = 'vB_Datastore_Filecache';
Other possible Classes are vB_Datastore_Turck (for stroing Datastore as shared memory using Turck MMCache) and vB_Datastore_Memcached.
Zero Tolerance
Thu 9th Jun '05, 7:16pm
In config.php put
$config['Misc']['datastore'] = 'vB_Datastore_Filecache';
Other possible Classes are vB_Datastore_Turck (for stroing Datastore as shared memory using Turck MMCache) and vB_Datastore_Memcached.
Yep, i'm blind - Thanks Kirby :)
- Zero Tolerance
Zachery
Thu 9th Jun '05, 8:07pm
It is working as far as I can see, but for anyone who is trying this (not sure if this is actually 100% supported yet) You will need to chmod the file or make sure that IIS / apache has the rights to write and modifiy the file (for you windows users)
RCA
Fri 10th Jun '05, 4:00pm
What about adding support for eAccelerator? Is same as mmturck, but with fixes and updates.
digitalpoint
Sat 11th Jun '05, 3:27am
Another request for eAccelerator support from me. :)
nexialys
Sat 11th Jun '05, 1:23pm
or just support for Zend would be good to... actually, it's the internal PHP Memcache... ;)
Zachery
Sun 12th Jun '05, 2:45pm
Isn't eAccelerator a continued work of mmcache?
digitalpoint
Sun 12th Jun '05, 3:13pm
Yep... MMCache is no longer developed (last release was November, 2003). eAccelerator (http://eaccelerator.net/HomeUk) picked up where MMCache stopped being developed.
Zachery
Sun 12th Jun '05, 3:14pm
Have you tried using the mmcache bit with eAccelerator?
digitalpoint
Sun 12th Jun '05, 3:24pm
I haven't to be honest. I thought about it, but figured I would wait to see if someone else tries it first. :)
Is the only thing that needs to be added the line in the config file?
Zachery
Sun 12th Jun '05, 3:58pm
Should be, I don't have a linux box as of yet to test anything out on, or I would have :)
digitalpoint
Sun 12th Jun '05, 4:21pm
Nope...
Fatal error: Turck MMCache not installed in /includes/class_datastore.php on line 41
RCA
Sun 12th Jun '05, 4:25pm
Just changing variable names in class_datastore.php will probably work.
mmcache_get -> eaccelerator_get
mmcache_put -> eaccelerator_put
etc etc
digitalpoint
Sun 12th Jun '05, 5:19pm
I went ahead and added a unique eAcclerator class to my class_datastore.php file for eAccelerator. Seems to work fine for me, so if vBulletin wants to work it into the distribution, that would be cool. :)
// ################################################## ###########################
// eAccelerator
/**
* Class for fetching and initializing the vBulletin datastore from eAccelerator
*
* @package vBulletin
* @version $Revision: 0.1 $
* @date $Date: 2005/06/12 13:14:18 $
*/
class vB_Datastore_eAccelerator extends vB_Datastore
{
/**
* Fetches the contents of the datastore from eAccelerator
*
* @param array Array of items to fetch from the datastore
*
* @return void
*/
function fetch($itemarray)
{
if (!function_exists('eaccelerator_get'))
{
trigger_error("eAccelerator not installed", E_USER_ERROR);
}
foreach ($this->defaultitems AS $item)
{
$this->do_fetch($item);
}
if (is_array($itemarray))
{
foreach ($itemarray AS $item)
{
$this->do_fetch($item);
}
}
$this->check_options();
// set the version number variable
$this->registry->versionnumber =& $this->registry->options['templateversion'];
}
/**
* Fetches the data from shared memory and detects errors
*
* @param string title of the datastore item
*
* @return void
*/
function do_fetch($title)
{
$data = eaccelerator_get($title);
if ($data === null)
{ // appears its not there, lets grab the data, lock the shared memory and put it in
$data = '';
$dataitem = $this->dbobject->query_first("
SELECT title, data FROM " . TABLE_PREFIX . "datastore
WHERE title = '" . $this->dbobject->escape_string($title) ."'
");
if (!empty($dataitem['title']))
{
$data =& $dataitem['data'];
$this->build($dataitem['title'], $dataitem['data']);
}
}
$this->register($title, $data);
}
/**
* Updates the appropriate cache file
*
* @param string title of the datastore item
*
* @return void
*/
function build($title, $data)
{
if (!function_exists('eaccelerator_put'))
{
trigger_error("eAccelerator not installed", E_USER_ERROR);
}
eaccelerator_lock($title);
eaccelerator_put($title, $data);
eaccelerator_unlock($title);
}
}
Andreas
Sun 12th Jun '05, 5:45pm
I did the same on my installation a few days ago and it has been working flawlessly :)
digitalpoint
Sun 12th Jun '05, 10:54pm
Quick note for people using eAccelerator as a datastore. I forgot eAccelerator doesn't work from the shell, so a couple custom processes I have that run from the shell (using the vBulletin architecture) were failing because vBulletin will halt if the eaccelerator_get function doesn't exist. So I changed the line in my config to this:
if (!$_SERVER['argc']) $config['Misc']['datastore'] = 'vB_Datastore_eAccelerator';
sHORTYWZ
Thu 16th Jun '05, 11:24am
Alright, I use eaccelerator - I added that class, put in the codeblock from DP into my config file - it seems to be working as I'm showing cached keys in eaccelerator.php now.
However, I'm confused about what this is doing besides what EAC normally does - anyone care to break it down real quick?
Thanks :)
Zachery
Thu 16th Jun '05, 12:01pm
Alright, I use eaccelerator - I added that class, put in the codeblock from DP into my config file - it seems to be working as I'm showing cached keys in eaccelerator.php now.
However, I'm confused about what this is doing besides what EAC normally does - anyone care to break it down real quick?
Thanks :)
Basicly its putting the vBulletin datastore directly into cache for direct access via memory, instead of having to be accessed from the database more often.
Ram disk > *
sHORTYWZ
Thu 16th Jun '05, 2:08pm
Gotcha, thanks.. Less DB hits = star in my book.
spiderweb
Mon 1st Aug '05, 12:09pm
I just tried turning this on after following the instructions and my board won't load. I get the following php errors.
\board\includes\datastore_cache.php on line 4523[01-Aug-2005 11:04:11] PHP Warning: Unexpected character in input: '\' (ASCII=92) state=1 in \board\includes\datastore_cache.php on line 4523[01-Aug-2005 11:04:11] PHP Parse error: parse error, expecting `')'' in \board\includes\datastore_cache.php on line 4523
turkforum
Wed 24th Aug '05, 7:29pm
We are trying 3.5 with mmcache anyone succeded to run both mmcache and 3.5 on a linux server please advice
Powered by vBulletin™ Version 4.0.0 Beta 4 Copyright © 2009 vBulletin Solutions, Inc. All rights