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

Merged
merged 2 commits into from May 21, 2024

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

common/dynamicconfig/constants.go Show resolved Hide resolved
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?

prathyushpv added a commit to temporalio/cli that referenced this pull request May 21, 2024
## What was changed
Setting the size of host level mutable state cache to 8k.

## Why?
There is a pending change is server
repo(temporalio/temporal#5894) that will enable
host-level mutable state cache. This cache was shard-level with a size
of 512. Cli server will only have one shard. Host level cache has a
default size of 128k to accomodate for all shards. But this size is too
big a cluster with 1 shard. Setting this size to more reasonable 8k for
server started from cli command.

## Checklist

1. Closes

2. How was this tested:

3. Any docs updates needed?
@prathyushpv
Copy link
Contributor Author

temporalio/cli#574
Set the cache size to 8k in cli..

@prathyushpv prathyushpv enabled auto-merge (squash) May 21, 2024 20:54
@prathyushpv prathyushpv merged commit 0f79e18 into main May 21, 2024
42 checks passed
@prathyushpv prathyushpv deleted the ppv/hostLevelCacheByDefault branch May 21, 2024 21:21
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