Bailey Kocin
03/26/2026, 2:13 AMBailey Kocin
03/26/2026, 2:31 AMRocky
03/26/2026, 2:31 AMBailey Kocin
03/26/2026, 2:31 AMRocky
03/26/2026, 2:32 AMdatacache_mem_size: This is the unified parameter in v4.0. It sets the maximum memory for the Page Cache. You can set this as a percentage (e.g., 20%) or a fixed size (e.g., 100G).
* disable_storage_page_cache: Ensure this is set to false (it is by default).
B. OS Page Cache
Since StarRocks uses standard I/O for reading local data files, the Linux OS will automatically cache "hot" file blocks in the remaining free RAM of your server.
* Tip: Don't allocate 100% of your machine's RAM to the StarRocks BE process (mem_limit). Leave some room (e.g., 10-20%) for the OS Page Cache to handle the raw file I/O.
C. Query Result Cache
If your "heavy repeated scans" are identical queries, you can bypass the scan entirely by caching the final result set.
* enable_query_cache: Set this session variable to true. This caches the final output of the query in memory.
Summary of what to tune:
For your specific setup (v4.0.7, Shared-Nothing, NVMe), ignore the datacache_disk_size (Block Cache) as it won't help with local tables. Instead, focus on:
1. Increase datacache_mem_size: Give more RAM to the Page Cache to keep more decompressed hot data in memory.
2. Monitor Page Cache Hit Rate: Check your BE metrics (via `curl http://be_host:be_http_port/metrics`) for starrocks_be_page_cache_hit_count to see if your cache is actually being utilized.
3. Check storage_page_cache_limit: In older versions, this was the primary name; in v4.0, it is managed via the unified Data Cache settings, but keeping an eye on both in your be.conf is a good idea.
To adjust these dynamically for testing:
sql
ADMIN SET FRONTEND CONFIG ("datacache_mem_size" = "20%");
-- Or per BE via the backend configuration API
I hope this clears up the "Remote only" vs "Local" confusion! Let me know if you need help finding specific metrics to verify your hit rates.
References
• data_source/data_cache.md
• administration/management/BE_configuration.md
• using_starrocks/caching/block_cache.mdRocky
03/26/2026, 2:32 AM