I installed a brand new drupal 5.7 and added the Cache Router module.
I did the same performance tests as there are in the module page. Performance with "db" engine is not bad for me:

Requests per second: 324.03 [#/sec] (mean)
Time per request: 15.431 [ms] (mean)

But when i do the same performance test with "file" engine, the performance is very bad:

Requests per second: 12.88 [#/sec] (mean)
Time per request: 388.210 [ms] (mean)

This is what id added to settings.php:

$conf['cache_inc'] = './sites/all/modules/cacherouter/cacherouter.inc';
$conf['cacherouter'] = array(
  'default' => array(
    'engine' => 'file',
    'server' => array(),
    'shared' => TRUE,
    'prefix' => '',
  ),
);

Am i missing something?

Regards,

Matias.

Comments

mburak’s picture

Also, i found these errors in my log file.

==> /etc/httpd/logs/error_log <==
[Mon Apr 14 12:02:01 2008] [error] [client 127.0.0.1] PHP Notice: Undefined index: in /mnt/20GB/local/dpc-solution/drupal/sites/all/modules/cacherouter/engines/file.php on line 14
[Mon Apr 14 12:02:01 2008] [error] [client 127.0.0.1] PHP Notice: Undefined index: cache in /mnt/20GB/local/dpc-solution/drupal/sites/all/modules/cacherouter/Cache.php on line 12

Thanks,

Matias.

btmash’s picture

While performance on my local computer seems decent, I continually got these notices as well - I see that there is no checking done on whether or not the cacherouter bin prefix is set or not - so I added some checks for the prefixes to the effect of:

if (isset($conf['cacherouter'][$bin]['prefix'])) {
  ...
}

And the warnings are no longer there. While I have only used apc and file caching, the differences were in:

  • cacherouter/engines/file.php
  • cacherouter/Cache.php
  • cacherouter/cacherouter.inc
slantview’s picture

I'm sorry, I've been out of the loop for a week due to some personal issues. I will take a look at this asap.

slantview’s picture

Hi, did you apply the cache serialization patches? Did you check write permissions for the "path" to the cache files?

-s

btmash’s picture

Ack...I should have created a warnings thread for the 6.x branch - The warnings and notices that I received were from the 6.x branch - that is where I needed to place the isset() checks.

mburak’s picture

Yes, i applied the patches but it's still not working. I have the right permissions to write in /tmp/filecache and i see that it's writing things there.

andypost’s picture

I changed Cache.php

  function __construct($bin) {
    global $conf;

    $this->name = $bin;
    //Check for bin in config
    if (isset($conf['cacherouter'][$bin])) {
      $this->prefix = $conf['cacherouter'][$bin]['prefix'];
    }
    else {
    	$this->prefix = $conf['cacherouter']['default']['prefix'];
    }
  }
eli’s picture

Based on the problems I was having, it appears to be because the 'page_cache_fastpath' variable is not set. Although it doesn't seem to be documented anywhere, you need to have a variable namde page_cache_fastpath set to '1' or else the file caching (and possible other engines) don't work at all

eli’s picture

That is to say, you want to add this to your settings.php:

$conf['page_cache_fastpath'] = 1;
slantview’s picture

Status: Active » Closed (works as designed)
btmash’s picture

Can the documentation for the project be updated in this case?

socialnicheguru’s picture

is what is outlined in #9 still needed?

Chris