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 haven't tracked down what is specifically causing this but seeing *a lot* of cache sets and variable table queries during a menu rebuild it's taking roughly twice as long.
Could be related to specific contrib modules, e.g. i18n.
Comment | File | Size | Author |
---|---|---|---|
#5 | memcache-flush-time-1896452-5-without-patch.txt | 1.52 KB | codycraven |
#5 | memcache-flush-time-1896452-5-with-patch.txt | 1.52 KB | codycraven |
#2 | memcache-ignore-identical-set-1896452-2.patch | 519 bytes | markpavlitski |
#1 | memcache-ignore-identical-set-1896452-1.patch | 518 bytes | Berdir |
Comments
Comment #1
BerdirOk, so one issue seems to be that admin_menu and others are doing hundreds and thousands of cache clears, resulting in variable_set() calls.
The attached patch improves this by adding a check to only update a variable if the value actually changes.
Comment #2
markpavlitski CreditAttribution: markpavlitski commentedCan I suggest that the identity operator (===) is used instead?
Comment #3
codycraven CreditAttribution: codycraven commentedThe patch supplied does not have any perceivable benefit in my testing. Load times are roughly the same when flushing all caches.
Comment #4
markpavlitski CreditAttribution: markpavlitski commented@codycraven Can you post your memcache configuration? And load testing details that you have recorded during menu rebuild (with and without memcached).
Comment #5
codycraven CreditAttribution: codycraven commentedPlease find the attached files logging the flush request and response. The flush with the patch actually took slightly longer than the flush without in this particular run. These times vary slightly from flush to flush.
My memcache config, with some values redacted with ...:
Comment #6
markpavlitski CreditAttribution: markpavlitski commentedStampede protection can cause a lot of slow-down when flushing the site cache.
Can you re-test with:
$conf['memcache_stampede_protection'] = FALSE;
Comment #7
codycraven CreditAttribution: codycraven commentedRemoved stampede protection and did not notice a benefit. I later found the big processing delay was due to the Git deploy module.
I don't have any meaningful data for this specific issue to claim that it needs work, marking back to needs review so that hopefully another user of the module can give their results.
Comment #9
Jeremy CreditAttribution: Jeremy at Tag1 Consulting commentedI don't see any regressions from this, and certainly it can result in an optimization. (In fact: it speeds up simplestest in my testing by about 15%).
Comment #10
BerdirWow, didn't expect this one ever to be committed anymore, after years of silence. Thanks :)
Comment #11
Jeremy CreditAttribution: Jeremy at Tag1 Consulting commentedI apologize for the neglect!
Comment #13
Jeremy CreditAttribution: Jeremy at Tag1 Consulting commentedBackporting
Comment #15
Jeremy CreditAttribution: Jeremy at Tag1 Consulting commentedAlso backported to 6.x-1.x ...