The memcached API provides an option to tell addServer what weight to give each server. this is handy in case you have several servers with different memory sizes (by default the key distribution is equal among the servers) . The Drupal module settings do not allow you to set this option. It will be nice as a feature in the next release.

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

nirl’s picture

Status: Active » Postponed

i will provide a patch for the 5.x version in the next week or so. Please do not bother with this at the moment.

nirl’s picture

i am summiting a patch against the 5.x-1.x-dev version.
whoever adds this patch to the CVS please also note that i've added a comment to the memcache_object function that should actually go into the readme file after the prefix part. or else no one will ever know how to use it.
also note that this patch is designed to be 100% backward compatible if you decide not to use the new feature.

nirl’s picture

Status: Postponed » Needs review
catch’s picture

Title: add support for server weight » Add support for server weight
Version: 5.x-1.x-dev » 7.x-1.x-dev
Category: feature » task
Status: Needs review » Needs work

This may be still valid as a feature request.

markpavlitski’s picture

Status: Needs work » Needs review
FileSize
2.28 KB

Patch for 7.x-1.x.

Adds optional server weight support for both extensions.

Compatible with existing $conf settings.

Can be fairly easily extended to allow additional options on a per-server basis.

Jeremy’s picture

Issue summary: View changes
FileSize
9.15 KB

I've reworked this and added documentation. It seems to work great with the PECL Memcached extension, but there's a lingering problem with the PECL Memcache extension. Specifically we're blocked by #2707407: Infinite recursion during bootstrap if lock_acquire() fails due to invalid Memcache URL as we can't specify weight during calls to p/connect(), but we get stuck in an infinite loop if we're using just addServer().

Anyway, work in progress attached.

Jeremy’s picture

FileSize
18.23 KB

Refreshing patch; this addresses the infinite recursion bug, however I'm seeing some oddities around persistent connections (which may or may not be related to this patch) and currently the memcache_admin stats pages is broken for the Memcached PECL extension.

  • Jeremy committed de47520 on 7.x-1.x
    Issue #332094 by Jeremy, nirl, markpavlitski: Add support for server...
Jeremy’s picture

Final round of cleanup, this seems to work well in all my testing. Committed.

Jeremy’s picture

Status: Needs review » Fixed

Status: Fixed » Closed (fixed)

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