temporal icon indicating copy to clipboard operation
temporal copied to clipboard

Changing MutableState cache to host-level by default

Open prathyushpv opened this issue 1 year ago • 3 comments

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

prathyushpv avatar May 09 '24 17:05 prathyushpv

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 avatar May 09 '24 19:05 prathyushpv

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.

dnr avatar May 09 '24 20:05 dnr

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 avatar May 14 '24 20:05 prathyushpv

https://github.com/temporalio/cli/pull/574 Set the cache size to 8k in cli..

prathyushpv avatar May 21 '24 20:05 prathyushpv