First time user of this module. Also, I'm attempting to get it working with Lando (Docker) on a dev machine.

It looks like Drupal isn't making any connections to memcached at all.

I'm using Lando's Drupal 8 "recipe" (looking at lando's source code it does a simple 'perl install memcached') plus the memcached container (have tested v1.4 and 1.5, ports: 0.0.0.0:11222->11211/tcp). I can connect from outside the container on 11222 and read the memcached stats, but there's no sign of any activity by Drupal.

In Drupal, I see slower page loads, occasional errors and, when I rebuild the cache - either via UI or Drush - all the cache tables in the DB are still populated.

I enabled the memcached_admin module - when I attempt to access stats there, I get a screenful of PHP errors from memcache_admin/src/Controller/MemcacheStatisticsController.php, specifically line 84 where it's trying to loop through the stats array.

For general page accesses, there are extra errors, typically to do with entities, but few if any mention memcached in the stack trace.

Grateful for any help…

Versions:
Drupal core 8.5.6
memcache 2.0.0-alpha 6

settings.php:

$settings['memcache']['servers'] = ['127.0.0.1:11211' => 'default'];
$settings['memcache']['bins'] = ['default' => 'default'];
$settings['memcache']['key_prefix'] = '';

$settings['cache']['default'] = 'cache.backend.memcache';

PHP / memcached:

PHP 7.1.21
Memcached version (3.0.4) is listed in /admin/status.

phpinfo() - memcached section:
Version 3.0.4
libmemcached version 1.0.18
SASL support yes
Session support yes
igbinary support no
json support no
msgpack support no

Directive / Local value / Master value
memcached.compression_factor 1.3 1.3
memcached.compression_threshold 2000 2000
memcached.compression_type fastlz fastlz
memcached.default_binary_protocol 0 0
memcached.default_connect_timeout 0 0
memcached.default_consistent_hash 0 0
memcached.serializer php php
memcached.sess_binary_protocol 1 1
memcached.sess_connect_timeout 0 0
memcached.sess_consistent_hash 1 1
memcached.sess_lock_expire 0 0
memcached.sess_lock_max_wait not set not set
memcached.sess_lock_retries 5 5
memcached.sess_lock_wait not set not set
memcached.sess_lock_wait_max 2000 2000
memcached.sess_lock_wait_min 1000 1000
memcached.sess_locking 1 1
memcached.sess_number_of_replicas 0 0
memcached.sess_persistent 0 0
memcached.sess_prefix memc.sess. memc.sess.
memcached.sess_randomize_replica_read 0 0
memcached.sess_remove_failed_servers 0 0
memcached.sess_sasl_password no value no value
memcached.sess_sasl_username no value no value
memcached.sess_server_failure_limit 0 0
memcached.store_retry_count 2 2

Comments

wturrell created an issue. See original summary.

lcatlett’s picture

$settings['memcache']['key_prefix'] = '';

lcatlett’s picture

$settings['memcache']['key_prefix'] = '';

lcatlett’s picture

$settings['memcache']['key_prefix'] = '';

lcatlett’s picture

woah - I'm not sure what is going on with the comment submit button submit button but my comment was submitted multiples times before it was complete. You may want to try setting the key_prefix value in addition to truncating all the existing cache tables that you intend to move to memcache. Drupal bootstraps from the database by default so there could be stale objects in the in the cache_* tables.

wturrell’s picture

Status: Active » Fixed

@lcatlett: Thanks. That advice on truncating helped, once I did that, Drupal stopped refilling the database tables.

The reason for the module not communicating with Memcached was more avoidable - I had the ports correct, but whilst the external connection uses localhost, the internal one (from the app container) is called "cache" (you can check by running lando info). With that changed, it works properly.

$settings['memcache']['servers'] = ['cache:11211' => 'default'];

atiindacity’s picture

Hello all,

I am newbee, i love to make it public my Drupal 8 site that i made from my LOCAL DEV. i use LANDO as my DEV and now my problem is what file i need to move to hosting. i am not sure what exactly. your help will be appreciated.

wturrell’s picture

@atiindacity See the User Guide chapter on installation. You may also be able to get some help in the forums. Failing that, talk to your hosting provider and see if they have Drupal instructions specific to them.

Memcached won't be available on shared hosts because it has no security restrictions (if installed on multiple sites, even with different key_prefixes, any site can freely access data from the others) - you need a separate dedicated server, VM or cloud instance.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.