Problem/Motivation
When debugging caching problems, it would be useful to have more information. Specifically, it would be good to log how long each action takes, and optionally how large of a value is being written to or read from the cache.
Beyond that, it would also be helpful to only log slow requests, and/or requests with larger value sizes.
Steps to reproduce
To enable all features, add some variation on the following options to settings.php:
$conf['memcache_debug_log'] = '/tmp/memcache.log';
$conf['memcache_debug_verbose'] = TRUE;
$conf['memcache_debug_size'] = TRUE;
$conf['memcache_debug_size_minimum'] = 5120;
$conf['memcache_debug_elapsed_minimum'] = 0.15;Proposed resolution
Add the requested functionality.
Remaining tasks
Patch needs review, testing, and performance testing.
User interface changes
None.
API changes
The internal _dmemcache_write_debug() function gains a parameter for tracking the value size.
Data model changes
Issue fork memcache-3352885
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #3
jeremy commentedImplements new features per the issue description:
https://git.drupalcode.org/project/memcache/-/merge_requests/13/diffs
Includes new documentation:
Comment #4
jeremy commentedComment #5
jeremy commentedI created some very large nodes, and then loaded them with this enabled to get the following logs:
In my test configuration I configured the debug log to only include objects over 5120 bytes and that take longer than 0.25 milliseconds to process:
The first two rows are part of a getMulti request for a large object was split into 182 pieces. You can see that each request is taking ~430 milliseconds, and that the objects have been split into 1,045,479 byte pieces The last line is a slow (0.27 millisecond) request for cache_bootstrap, which is 6,348 bytes in size.
Comment #6
japerryClosing as Drupal 7 is no longer supported.