Understanding Sticky Cache Size


I’m a bit confused by the sticky cache size in a namespace.

The SDK metric is reporting ~7,500 as seen by

sum by (namespace) (${WorkerName}_temporal_sticky_cache_size)

And there are only ~2,000 running workflows.

Shouldn’t the sticky cache size be around 2,000 assuming all workflows are cached?

Maybe I’m misunderstanding what the sticky cache is? Or maybe a workflow can be cached in more than one worker thus it would be a function of #workers X #running workflows?



It is a cache. It is used for performance optimization only. So, there is no need to cache all workflows in flight unless you are implementing a very latency-sensitive use case.

The total cache size is the cache size of a single worker multiplied by the number of workers.

1 Like