Problem/Motivation

Bug because this is a performance problem.

See #2765271: Rationalize use of the 'discovery' cache bin, since it's stored in the limited size APCu by default for background and data. views_data is in my case 3MB of data, storing that in apcu is not a good idea. We also don't need it on most requests.

Proposed resolution

Two options:

1. Easy: Completely move all entries to the data cache bin. Do so by changing the service definition for the token service and pass in cache.data instead of cache.discovery.
2. A bit more complicated: Add data as a second cache bin, store the full cache in there, the tables still in discovery.

I would suggest we start with 1. On my pretty big site with empty render cache, my frontpage loaded 19 tables from cache. I didn't count but I expect that e.g. render cache did a lot more cache gets there.

Remaining tasks

User interface changes

API changes

Data model changes

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Berdir created an issue. See original summary.

Berdir’s picture

Issue summary: View changes
Berdir’s picture

Title: Changed ViewsData to use the data cache bin instead of discovery » Change ViewsData to use the data cache bin instead of discovery
dawehner’s picture

Yeah let's go with 1)
If you have to handtune on that level of detail, you probably have much bigger issues you can solve in the first place.

Wim Leers’s picture

Yep, let's go with option 1. Much simpler.

Wim Leers’s picture

Issue tags: +php-novice
catch’s picture

The individual tables should only be queried when views is a render cache miss anyway, so agreed seems fine to move the whole lot - going to be small compared to actually running the query and rendering the view.

Ginovski’s picture

Assigned: Unassigned » Ginovski
Status: Active » Needs review
FileSize
5.71 KB

1. Changed the services to pass cache.data instead

Berdir’s picture

Status: Needs review » Needs work

That's too much. *Only* ViewsData must be changed.

Ginovski’s picture

Status: Needs work » Needs review
FileSize
676 bytes

Changed only Viewsdata.

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community
Berdir’s picture

+1, #2824548: Move token info cache to data cache bin shows the size of cache_discovery before/after applying the two patches.

catch’s picture

Status: Reviewed & tested by the community » Needs work

Like the token issue, this should use cache.default I think. cache.data is for unbounded items.

Wim Leers’s picture

Issue tags: +Needs reroll
faline’s picture

Assigned: Ginovski » Unassigned
Status: Needs work » Needs review
FileSize
679 bytes

Change cache.data to cache.default

Wim Leers’s picture

Status: Needs review » Reviewed & tested by the community
Issue tags: -Needs reroll

Perfect, thank you! :)

alexpott’s picture

Title: Change ViewsData to use the data cache bin instead of discovery » Change ViewsData to use the default cache bin instead of discovery
alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed 11c68ce and pushed to 8.3.x. Thanks!

  • alexpott committed 11c68ce on 8.3.x
    Issue #2824547 by Ginovski, faline, Berdir, Wim Leers, catch: Change...

Status: Fixed » Closed (fixed)

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

xjm’s picture

Issue tags: +8.3.0 release notes