<@U0A71G31CDV> StarRocks doesn’t have any cache is...
# questions-and-troubleshooting
d
@Rocky StarRocks doesn’t have any cache isolation so one use case can evict the cache of other use case. how to solve this? how to make cache deterministic
d
@Rocky how to solve this
d
@Rocky I don’t need these links to configure cache, i want to know how to keep cache isolation
r
Short answer: there is no per-workload cache quota/reservation in StarRocks, so you can't make the Data Cache deterministic. What you can do is (a) reduce cross-workload pollution, (b) prevent one workload from writing into the cache at all, and (c) get real isolation by splitting compute. 1. Use SLRU instead of LRU (best-effort protection, not isolation)
datacache_eviction_policy
(BE config, default
slru
since v3.4.0, not mutable). SLRU splits cache into an eviction segment and a protection segment: data enters the eviction segment on first access and is promoted to the protection segment only when accessed again. This specifically resists "sudden sparse traffic" — a one-off scan won't directly evict your hot working set. It's the closest thing to protection the docs describe, but it's a heuristic, not a guarantee. 2. Stop the noisy workload from populating the cache Since population is what causes the eviction pressure, control it per session: •
SET populate_datacache_mode = 'never'
— the scan reads from remote storage but never writes into the cache. (`auto`/`always`/`never`, v3.3.2+) •
SET enable_scan_datacache = false
— bypass the data cache entirely for that session. •
SET skip_local_disk_cache = true
— marks scan ranges to skip the local disk cache (v3.3.9/v3.4.0/v3.5.0). Note StarRocks already skips population for non-SELECT statements and for queries that scan all partitions or all columns of a table. 3. Isolate by compute, not by cache In a shared-data cluster the cache is local disk on each CN, so workloads routed to different warehouses (i.e. different CN sets) don't share cache at all — that's the only mechanism that actually gives you isolation. In shared-nothing, the equivalent is putting the workloads on disjoint BE node groups. Caveat:
enable_datacache_sharing
(v3.5.1+, default
true
) lets a node fetch blocks from other nodes in the cluster on a local miss, so if you rely on node separation, consider whether that's on. 4. Warm up before critical queries, but don't rely on it
CACHE SELECT ...
(v3.3.0+) pre-populates the cache. The docs explicitly warn that warmed data "may still be evicted based on the SLRU rule" — so it improves hit rate, it does not pin data. What doesn't exist: I found no documented per-tenant/per-workload cache quota, partition, or reservation for Data Cache, and no per-query cache pinning.
datacache_disk_size
/
datacache_mem_size
are per-BE/CN, and resource groups control CPU, concurrency and memory — not cache capacity. So "deterministic cache" isn't achievable today; the honest engineering answer is: separate warehouses for the workloads that must not interfere, plus
populate_datacache_mode=never
on the polluting workload, plus SLRU. If you need a guaranteed quota, that's worth raising with the maintainers on GitHub (github.com/StarRocks/starrocks) or in the community Slack — I don't want to speculate on whether it's on the roadmap. References • deployment/shared_data/feature-support-shared-data.md • sql-reference/System_variable.md • data_source/block_cache_warmup.md • data_source/data_cache.md