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

Changing MutableState cache to host-level by default #5894

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

prathyushpv
Copy link
Contributor

@prathyushpv prathyushpv commented May 9, 2024

What changed?

We had added a configuration flag to make MutableState cache a host-level cache.
Changing dynamic config to enable this flag by default and adjusting cache size to 128K. We found that this size is appropriate for most workloads we see.

Also setting host-level cache size to be 8K in development dynamic config.

Why?

Host level cache is better for cache utilization and it prevents the problem of a smaller shard-level cache getting full with pinned elements.

How did you test it?

Running the cluster with load.

Potential risks

None

Documentation

Is hotfix candidate?

No

@@ -1254,12 +1254,12 @@ will wait on workflow lock acquisition. Requires service restart to take effect.
)
EnableHostHistoryCache = NewGlobalBoolSetting(
"history.enableHostHistoryCache",
false,
true,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this enabled in functional tests?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let me check that.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not enabled in functional tests. But it is not disabled explicitly. So after merging this change, it should be enabled.

Copy link
Member

@yiminc yiminc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What will happen to the CLI dev server?

@prathyushpv
Copy link
Contributor Author

What will happen to the CLI dev server?

I am explicitly setting cli dev server cache size to be 8k in dynamic config yaml file: https://github.com/temporalio/temporal/pull/5894/files#diff-18c8bb8717f6896034d89c0eb07448ffce8fe45aeb752362b798ce18ef22e92f

This should limit the cache size in dev server.

@prathyushpv prathyushpv marked this pull request as ready for review May 9, 2024 19:59
@prathyushpv prathyushpv requested a review from a team as a code owner May 9, 2024 19:59
@dnr
Copy link
Member

dnr commented May 9, 2024

What will happen to the CLI dev server?

I am explicitly setting cli dev server cache size to be 8k in dynamic config yaml file: #5894 (files)

This should limit the cache size in dev server.

The cli (temporal server start-dev) doesn't have access to those files. Those are for server development.

I'd also recommend trying to keep those files as short as possible. In local testing we should run as close to the default as possible.

@prathyushpv
Copy link
Contributor Author

What will happen to the CLI dev server?

I am explicitly setting cli dev server cache size to be 8k in dynamic config yaml file: #5894 (files)
This should limit the cache size in dev server.

The cli (temporal server start-dev) doesn't have access to those files. Those are for server development.

I'd also recommend trying to keep those files as short as possible. In local testing we should run as close to the default as possible.

Right! Default host level cache size is 128K entries. That is very large for local clusters. Previously it was per-shard and cli server only has 1 shard. Do you think if setting this dynamic config key(cache size) in cli a good idea?

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

Successfully merging this pull request may close these issues.

None yet

4 participants