Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
I am using memcache on high load server with pressflow for Drupal6, varnish and apc and when monitoring memcache I notice that most of time memcache write only.
So I backport memcache-lock.inc from D7 to Drupal 6 and attached file.
What do you think?
Comment | File | Size | Author |
---|---|---|---|
#1 | memcache-lock.inc_.txt | 3.24 KB | iamer |
memcache-lock.inc_.tar_.gz | 1.41 KB | melsawy |
Comments
Comment #1
iamer CreditAttribution: iamer commentedChanging title and status since there is a patch to be reviewed.
Comment #2
nnewton CreditAttribution: nnewton commentedI've done some initial testing of this and it appears to work. I'm rather surprised that this port is in fact a single line change, but I guess thats a good thing.
-N
Comment #3
Terko CreditAttribution: Terko commentedHow I can implement this? This is new file, we need only to copy it in the memcache module folder?
Comment #4
robertDouglass CreditAttribution: robertDouglass commented@teri@uhaaa.com, you'd include the memcache-lock.inc file in your sites/all/modules/memcache directory, then add
$conf['lock_inc'] = './sites/all/modules/memcache/memcache-lock.inc';
in settings.php.Note that if this gets committed I'm changing the file to memcache_lock.inc - it drives me nuts that the memcache-session.inc file has a dash instead of underscore.
Comment #5
danielnolde CreditAttribution: danielnolde commentedWhere does this file/variable get used in code?
Having added the line in #4 to settings.php and stored the file of #1 (renamed to memcache-lock.inc, of course), nothing changed with this patch regarding low hit-rates. But i couldn't find any place in the code, where this file/variable is ever used ... so am i missing a small but important information here?
Comment #6
longwaveIt is a memcache implementation that replaces http://api.drupal.org/api/drupal/includes--lock.inc - it should help with contention on high traffic sites, the low hit rate issue is a separate problem being dealt with in #911232: A high percentage of getMulti operations are failing to hit cache.
Comment #7
Jeremy CreditAttribution: Jeremy commentedI have committed this include file to the D6 project, thanks!
We now need patches to update the documentation. Marking as needs work.
Comment #8
dalinThis totally did not work for me. I tested in my staging env and everything worked fine. I deployed to production and the site just fell over. Pages mostly would time out, but a few would load. I tried a few times to be sure that this was the problem.
This is unfortunate as semaphore queries are showing in my slow query log. Perhaps something is initiating locks on a regular basis that shouldn't be.
Comment #9
catch@dalin - please try the latest dev of memcache - it has some fixes for the lock implementation. Also #969998: Shorter lock_wait() polling time will allow processes to continue quicker once the lock becomes available.