1

I've got a Drupal site running with

  • 1 x Load balancer in front
  • 2 x web servers running Apache, PHP and Drupal, traffic coming from load balancer, and
  • 1 x Generic server hosting MySQL (MariaDB) Drupal database and sites/default/files accessed by the above 2 servers over the network.

If I wish to use memcached, would it work if I install memcached on the 2 web servers and configure Drupal to connect localhost using the memcache module?

Edit: are there any special consideration in order to make this work? I think I have read somewhere about session stored.

1 Answer 1

1

Short answer is yes, that's a fairly common configuration. You might also want to consider using Nginx instead of Apache.

For user session support, it's possible to use Memcache. However, memcache data is more transient and you may prefer the more persistent storage, for longer and more durable user sessions, that the database engine provides.

For cache_form you should use a more persistent cache, such as the database, to avoid form cache validation errors.

e.g: $conf['cache_class_cache_form'] = 'DrupalDatabaseCache';

It's recommended to use Memcache for the lock API layer as it's quick read/write and short cache lifetime is suitable.

e.g: $conf['lock_inc'] = 'sites/all/modules/contrib/memcache/memcache-lock.inc';

For Memcache integration with Drupal, you can use https://www.drupal.org/project/memcache or https://www.drupal.org/project/memcache_storage

1
  • Ahh I see, are there anything I need to take special care of? I think I have read somewhere that the session may need to be store outside of memcache, is that true?
    – sunnz
    Sep 10, 2016 at 3:52

Your Answer

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

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