Needs work
Project:
Cache Router
Version:
6.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
27 Jan 2009 at 17:33 UTC
Updated:
28 Jan 2009 at 01:35 UTC
This (untested and experimental) code allows to create a primary / secondary engine.
To use, configure it this way:
$conf['cache_router'] = array(
'<bin>' => array(
'engine' => 'hiearchical',
'primary_engine' => array(
// Your primary (authoritative) engine configuration.
'engine' => 'db',
'server' => array(),
'shared' => TRUE,
),
'secondary_engine' => array(
// Your secondary (slave) engine configuration.
'engine' => 'apc',
'server' => array(),
'shared' => TRUE,
),
// The maximum inconsistency window.
'tombstone_delay' => 10,
),
);
| Comment | File | Size | Author |
|---|---|---|---|
| hierarchy-router.patch | 3.3 KB | damien tournoud |
Comments
Comment #1
damien tournoud commentedComment #2
david straussThe caching hierarchy needs to understand two things:
* Which engines are known to guarantee coherency. All engines do on a single server. APC does not when you have multiple web servers.
* Storage into the cache(s) must have an option to specify whether coherency is required. Coherency should be required by default.
Comment #3
david straussComment #4
damien tournoud commentedFor D6 and the cache router, it is your responsibility to configure all this correctly, by understanding which "cache bin" requires consistency and which cache engine is able to offer it. The "hiearchy" set up by design never guarantees consistency, but requires that at least the "primary engine" does.
For D7, I suggest we implement a "cache location" parameter. This could be "node local", "cluster wide, short-term" and "cluster wide, long-term". Depending of the cache engines installed, the routing algorithm will choose an engine to satisfy the requirements of the caller. On a stock Drupal install, all those will be stored in db. On a more advanced setup, those could be APC, Memcache and DB respectively.
Comment #5
slantview commentedwow, this is like a dream, i've been wanting to work on this for so long.
thank you x 100.
my typical recommendation for people is to use cache router in the following manner
shared hosting:
use file cache and/or apc if available
single server:
use apc cache and/or memcache.
multiple web servers:
use memcache only
although with the heirarchalCache, we could make the following recommendations:
shared hosting:
use file cache and apc if available, secondary cache use db
single server:
use apc and/or memcache, and either db or file as backup
multiple server:
use memcache with either file or db backup