Memcached distributed problem

We encourage users to post events happening in the community to the community events group on https://www.drupal.org.
cbccharlie's picture

Hi,

I have a drupal installation with two frontend servers, which have a memcached server in each. If I'm surfing the frontend 1 and the frontend 2 memcached goes down, the page stops loading correctly. Has anyone ever had this problem?

Thank you very much.

Comments

What is memcache configuration?

kbahey's picture

Do you use "consistent" for the hash strategy in your php.ini

memcache.hash_strategy=consistent

http://www.php.net/manual/en/memcache.ini.php#ini.memcache.hash-strategy

This is now the default (I think starting with PHP 5.5), but that is not the case with older version.

Drupal performance tuning, development, customization and consulting: 2bits.com, Inc..
Personal blog: Baheyeldin.com.

Thank you very much, but I

cbccharlie's picture

Thank you very much, but I already have turned this property for PECL memcached (memcached.sess_consistent_hash = On)

I use PHP Version 5.3.3.

What about settings.php?

kbahey's picture

What about settings.php?

Is it the same on each application server? Do you list more than one memcache instance, by the same IP address?

For example:

$conf['memcache_servers']    = array(
  '10.0.0.11:11211' => 'default',
  '10.0.0.12:11211' => 'default',
);

Drupal performance tuning, development, customization and consulting: 2bits.com, Inc..
Personal blog: Baheyeldin.com.

My config

cbccharlie's picture

My config is:

$conf['memcache_servers'] = array(
  '192.168.130.222:11211' => 'default',
  '192.168.130.224:11211' => 'default',
);

Some things to check...

FluxSauce's picture

Are you sure that the application isn't sharing the same memcached configuration for one server? Have you checked the usage of the two memcached servers?

Are you using a memcached cluster? If not, why do you have two distinct servers for the same application? If distinct, that's making your caching backend do twice the work.

I use a distributed

cbccharlie's picture

I use a distributed memcached.

My server config is:

$conf['memcache_servers'] = array(
'192.168.130.222:11211' => 'default',
'192.168.130.224:11211' => 'default',
);
$conf['memcache_options'] = array(
Memcached::OPT_DISTRIBUTION => Memcached::DISTRIBUTION_CONSISTENT,
);

Thank you very much.

PHP memcached vs. PHP memcache

kbahey's picture

So, you are using the memcached PECL package, not memcache (without a "d").

I have seen issues with it a while back.

Try going with the memcache package instead and add the hash_strategy=consistent to php.ini, and see if it makes a difference.

Drupal performance tuning, development, customization and consulting: 2bits.com, Inc..
Personal blog: Baheyeldin.com.

I tried memcache package and

cbccharlie's picture

I tried memcache package and now the site load properly, although a node is stopped.
Thank you very much for everything.

Little confusion

roynilanjan's picture

Without the memcached PHP extension is it possible to use class Memcached? OR Memcached is also available in memcache PHP extension, as far http://www.dugwood.com/895442.html all the constants e.g. OPT_DISTRIBUTION are available for memcached PHP extension

High performance

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds:

Hot content this week