[MGNLCACHE-240] Optimise EhCache3Factory cache wrapping functionality Created: 11/Feb/21  Updated: 11/Dec/23

Status: Open
Project: Cache Modules
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Neutral
Reporter: Aleksandr Pchelintcev Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: dx-core-6.3
Remaining Estimate: Not Specified
Time Spent: 16m
Original Estimate: Not Specified

Issue Links:
Relates
relates to MAGNOLIA-9051 Improve cache performance on public i... Open
Template:
Acceptance criteria:
Empty
Task DoD:
[ ]* Doc/release notes changes? Comment present?
[ ]* Downstream builds green?
[ ]* Solution information and context easily available?
[ ]* Tests
[ ]* FixVersion filled and not yet released
[ ]  Architecture Decision Record (ADR)
Epic Link: cache performance

 Description   

Problem

EhCache3Factory wraps the EhCache instances into Magnolia adapter abstractions

  • accessed on every request
  • doesn't cache the wrappers
  • wrapper c-tor eventually instantiates couple of thousand mutexes (just an expensive operation)

As it can be seen on the picture below - the problem is triggered by the SiteAwareCacheFilter implementation which dynamically resolves the page cache.
(cc rkovarik - can you pls help understand how locking will even work in this situation - each request will seem to get its own blocking cache wrapper around EhCache and -> own set of locks... or not?)

!https://s3-us-west-2.amazonaws.com/secure.notion-static.com/0084f036-d821-4307-a3d5-dfc7b9ae923e/Untitled.png(https://s3-us-west-2.amazonaws.com/secure.notion-static.com/0084f036-d821-4307-a3d5-dfc7b9ae923e/Untitled.png)
The problematic

Solution

Cache the wrappers (it is after all only several of them and they typically don't change)


Generated at Sun Feb 11 23:53:34 CET 2024 using Jira 9.4.2#940002-sha1:46d1a51de284217efdcb32434eab47a99af2938b.