Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further caching fix - use metadata cache #24294

Merged
merged 1 commit into from
Aug 18, 2022

Conversation

eileenmcnaughton
Copy link
Contributor

@eileenmcnaughton eileenmcnaughton commented Aug 18, 2022

Overview

Further caching fix - use metadata cache

Before

This cache access construct
$optionValues = CRM_Utils_Cache::singleton()->get($cacheKey);`

After

Uses

  if (Civi::cache('metadata')->has($cacheKey)) {
      return Civi::cache('metadata')->get($cacheKey);
    }

Technical Details

This is a performance fix - for Redis users the current method never uses the array cache whereas the latter does. In conjunction with #24156 I got about another 10% improvement on Contact updates in our staging environment.

The data is a bit murky in prod as I accidentally undeployed the first patch when I first deployed this (where it the U goes back up again) & then when I re-deployed (where it shoots back down again) our high volume ended just as it was starting to look like this would show a clear-cut boost (those zig-zags at the end are when traffic slowed & we started working with a colder cache / less consistent run size)

image

Comments

@civibot
Copy link

civibot bot commented Aug 18, 2022

(Standard links)

@colemanw
Copy link
Member

One problem is that we have too many functions in CiviCRM that fetch option values, and each one has its own idea about caching.

@eileenmcnaughton
Copy link
Contributor Author

@colemanw surely not :-)

@totten
Copy link
Member

totten commented Sep 9, 2022

(@colemanw) ..[we have] many functions in CiviCRM that fetch option values...

Do we have a list somewhere? Maybe there's an OptionGroup for that...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants