Since authcache cannot currently handle table caching, the memcache module is also utilized to provide this added functionality. However, if both are enabled in the settings.php file, the authcache module will not read in the $conf for its needs.
$conf['cache_inc'] = './modules/authcache/api/authcache.inc';
$conf['authcache'] = array(
'default' => array(
'engine' => 'memcache', // apc, memcache, db, file, eacc or xcache
'server' => array('localhost:11220'), // memcached (host:port, e..g, 'localhost:11211')
'shared' => TRUE, // memcached shared single process
'prefix' => '', // cache key prefix (for multiple sites)
'path' => 'files/filecache', // file engine cache location
'static' => TRUE, // static array cache (advanced)
),
);
$conf = array(
'cache_inc' => './modules/memcache/memcache.inc',
'memcache_servers' => array(
'localhost:11211' => 'default',
'localhost:11212' => 'block',
'localhost:11213' => 'content',
'localhost:11214' => 'filter',
'localhost:11215' => 'form',
'localhost:11216' => 'menu',
'localhost:11217' => 'page',
'localhost:11218' => 'update',
'localhost:11219' => 'views',
),
'memcache_bins' => array(
'cache' => 'default',
'cache_block' => 'block',
'cache_content' => 'content',
'cache_filter' => 'filter',
'cache_form' => 'form',
'cache_menu' => 'menu',
'cache_page' => 'page',
'cache_update' => 'update',
'cache_views' => 'views',
),
);
I also tried this for using the APC engine as well for the authcache, but the same error appears:
Authcache settings.php Not enabled
The settings.php file must be modified to support the Auchache API. See README.txt
Comment | File | Size | Author |
---|---|---|---|
#8 | Modified init file for memcached start/stop script | 2.31 KB | Swampcritter |
#8 | Modifications needed for combining both Authcache & Memcache API within settings.php | 1021 bytes | Swampcritter |
#4 | duality_auth_memcache.patch | 3.91 KB | Swampcritter |
Comments
Comment #1
SwampcritterHowever, if you which around the placement of the $conf (where AuthCache $conf is seen first), then the Memcache API $conf is not read in, thus disabled.
Comment #2
Jonah Ellison CreditAttribution: Jonah Ellison commentedThe difficulty here is that Drupal only allows one contributed cache module. Authcache uses CacheRouter for its caching, so technically it should already be caching tables since this is what CacheRouter does.
You are correct about your settings being overridden. The Memcache $conf array is overriding the Auchache settings. You should define the keys on separate lines, like $conf['memcache_servers'] = .... $conf[''memcache_bins'], etc, to avoid this.
Theoretically, you should be able to use the Memcache module and Authcache together (note that I haven't tested this). First, remove the $conf['cache_inc'] = './modules/authcache/api/authcache.inc' line. Then you will need to modify Memcache's memcache.inc file to use Authcache's page_cache_fastpath() function (this function serves pages from the cache). See http://drupal.org/node/422250 for the code. Remove the $cache variable, remove
if ($cache->page_fast_cache('cache_page'))
, and replace $cache->get(..) with cache_get(...)Comment #3
SwampcritterWell, theoretically -- it actually worked. I made the changes to the memcache.inc file as you has said and added in the Authcache's page_cache_fastpath() function. I then created a new configuration layout and now both memcache and authcache modules (and features) can be utilized at the same time.
Since our Drupal development team are having problems with the 'modules' page for how long it takes to do a authenticated user (admin) refresh under D6 (there is something like 20+ modules being used), I used it as a control base for my tests.
D6 w/ no caching enabled: 4 minutes
D6 w/ Drupal caching enabled: 3.5 minutes
D6 w/ Memcache API enabled: 2.5 minutes
D6 w/ AuthCache enabled: 3 minutes
D6 w/ Memcache Multi-Instance enabled: 1.5 minutes
D6 w/ patch added (Memcache + Authcache) enabled: 45 seconds
The front page of the D6 site was also pressing it a bit for all of the blocks and views that are laid out.
NOTE: Times given are until the entire page is rendered with external ads calls turned off.
D6 w/ no caching enabled: 75 seconds
D6 w/ Drupal caching enabled: 45 seconds
D6 w/ Memcache API enabled: 25 seconds
D6 w/ AuthCache enabled: 15 seconds
D6 w/ Memcache Multi-Instance enabled: 8 seconds
D6 w/ patch added (Memcache + Authcache) enabled: 3 seconds <-- For an authenticated user (admin)
D6 w/ patch added (Memcache + Authcache) enabled: 1.5 seconds <-- For an un-authenticated user
Comment #4
SwampcritterPatch attached
Comment #5
Jonah Ellison CreditAttribution: Jonah Ellison commentedThanks for posting this. Authcache beta7 now integrates with the Memcache module. No need to hack the module. (If you upgrade to beta7, you'll need to remove the changes from memcache.inc)
Comment #6
SwampcritterWith the beta7 patch, does this also reflect that both modules (i.e. Authcache, memcache_admin) can be enabled as well? Cause before it would allow only one or the other to be enabled prior to the duality patch.
Comment #7
Jonah Ellison CreditAttribution: Jonah Ellison commentedYep! Both can be enabled at the same time, though $conf['cache_inc'] has to be authcache.inc. authcache.inc checks to see if $conf['memcache_servers'] is defined, and if it is, it includes memcache.inc and uses Memcache's caching system instead of Cache Router.
http://cvs.drupal.org/viewvc.py/drupal/contributions/modules/authcache/a...
Comment #8
SwampcritterFor those that are wondering about the multi-instance of memcached setup (it really created a huge performance boost for larger Drupal sites), I am attaching the modified init file [based on RedHat/CentOS/Fedora] and the settings.php modifier for combining both Authcache and Memcache API together based on the new beta7 format.