Problem/Motivation

Profiling a site with memcache enabled, I noticed that memcache statistics are enabled by default. This was only ever supposed to be opt-in and behind a permissions check, both of which are commented out, but this leaves them defaulting to on.

Per the screenshot, this is leading to maybe 12ms of walltime as well as 1mb of memory from collecting the stats.

Steps to reproduce

Proposed resolution

Remaining tasks

User interface changes

API changes

Data model changes

Issue fork memcache-3621859

Command icon 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

catch created an issue. See original summary.

catch’s picture

Status: Active » Needs review

Everything in statsInit would have to be completely refactored for this to work - e.g. it would need to check $settings, maybe whether the container is available, then check permissions. All the things that are commented out are 7.x-era code. So we can just return FALSE from there - then open a follow-up to either remove the statistics support altogether or re-introduce a $settings-based configuration.

peri22’s picture

Status: Needs review » Reviewed & tested by the community

Checked on '8.x-2.x' HEAD, pipeline is green. RTBC.

Maybe worth noting for the follow-up: with this, 'memcache_admin's "Show memcache statistics at the bottom of each page" option no longer shows anything, since 'requestStats()' is only filled by 'statsWrite()'.

japerry made their first commit to this issue’s fork.

  • japerry committed 50d2ec00 on 8.x-2.x authored by catch
    Issue #3621859 by catch: ensure memcache statistics are not collected by...
japerry’s picture

Status: Reviewed & tested by the community » Fixed

Maybe worth noting for the follow-up: with this, 'memcache_admin's "Show memcache statistics at the bottom of each page" option no longer shows anything, since 'requestStats()' is only filled by 'statsWrite()

Agreed, that is a good followup issue. Otherwise, fixed!

Now that this issue is closed, review the contribution record.

As a contributor, attribute any organization that helped you, or if you volunteered your own time.

Maintainers, credit people who helped resolve this issue.

Status: Fixed » Closed (fixed)

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