-
Bug
-
Resolution: Unresolved
-
Major
-
37.0.0.Final
-
None
-
---
-
---
Currently, the Infinispan TimerService implementation exposes a max-active-timers attribute that enables the eviction/passivation of the least frequently used timers when the number of timers exceeds the specified threshold.
As discussed in WFLY-20839, an optimal eviction policy for the timer use case would chose those timers whose next timeout is furthest in the future (i.e. more likely to have been updated recently), rather than chosing those timers used least frequently (i.e. likely the worst choice).
Unfortunately, Caffeine does not expose any mechanism to override its TinyLFU algorithm, and has no plans to support this: https://github.com/ben-manes/caffeine/issues/100
In lieu of this, we should replace the enforcement of this threshold from Infinispan/Caffeine to the timer scheduler itself.
The timer scheduler maintains an collection of timer IDs ordered by timeout. If this collection grows beyond the configured threshold, we can easily determine the optimal set of entries to evict from the backing Infinispan cache.
- relates to
-
WFLY-20918 Add max-idle based eviction configuration for distributable HttpSessions, SFSBs, Timers
-
- Open
-
-
WFLY-20839 Remove max-active-timers from default configuration
-
- Open
-