-
Notifications
You must be signed in to change notification settings - Fork 937
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
Add active cache eviction for history service #7547
Open
PowerStateFailure
wants to merge
21
commits into
temporalio:main
Choose a base branch
from
PowerStateFailure:active-cache-eviction
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Add active cache eviction for history service #7547
PowerStateFailure
wants to merge
21
commits into
temporalio:main
from
PowerStateFailure:active-cache-eviction
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What changed?
Add active cache eviction for history service (mutablestate and event caches) implemented as background routine per cache instance that periodically evicts at most N expired elements from cache. The eviction interval and number of elements to be evicted during iteratino (N) can be configured via dynamic config on per-instance base.
The feature is disabled by default.
Why?
In our use-cases Temporal server is deployed in very restricted environments where it shares resources with different services for different use-cases. We faced that after load spikes Temporal keeps consume memory allocated by caches forever (related issue: #4233), and then we found that Temporal implements only passive memory eviction for caches (the terminology is taken form Redis), i.e. element will be removed from cache only when inserting new element in already full cache. Thus we implement active cache eviction and decided to return it back into upstream.
How did you test it?
Tested with our internal fork running in several on-premise environments.
Potential risks
Since the feature is disabled by default, any problems are rarely expected.
Documentation
Is hotfix candidate?