4

I am successfully using the APC Cache module on my prod website (single server). APC is performing good, caching is done very well. I wonder could I gain anything more by implementing Memcache.

I tried it briefly on dev server, I see they can run one with another (Memcached Admin shows many hits in log). But i do not see any performance gain (haven't done precise measurements).

I should mention it is pretty large site, i use 256MB for APC (sometimes cache use is almost full), there is many content types, fields, nodes(over 10k), contrib modules (425 tables in db).

I am pasting at the end of the question my settings.php config (dev, prod just have not memcached implemented). There seems not much logic if i use cache_default_class twice, as Memcache will be used (declared lately).

So - have anyone used those two together when using one server? Is there any performance gain ? What are config ?

In addition, Memcached Readme.txt suggests using

$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';

but APC Readme.txt does not suggest that. I wonder why ?

Here is my code (using APC for Drupal backend cache)

# APC
$conf['cache_backends'] = array('sites/all/modules/contrib/apc/drupal_apc_cache.inc');
$conf['cache_default_class'] = 'DrupalAPCCache';
$conf['page_cache_without_database'] = TRUE;
$conf['page_cache_invoke_hooks'] = FALSE;

# Memcache
$conf['cache_backends'][] = 'sites/all/modules/contrib/memcache/memcache.inc';
$conf['cache_default_class'] = 'MemCacheDrupal';
$conf['cache_class_cache_form'] = 'DrupalDatabaseCache';
0

1 Answer 1

4

Putting the cache_form on the database is a good idea. I will help to prevent errors like this: http://drupal.org/node/500646

APC vs Memcache when it comes to the drupal cache mainly comes down to a persons preference. Mine is towards memcache because it allows for a multiple web head server setup. Performance wise APC will usually be a touch quicker, but my vote is still for memcache even on single server setups.

1
  • 1
    APC doesn't have the best cache strategy when it is full. Memcache does true LRU.
    – mpdonadio
    Commented Mar 16, 2013 at 22:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.