aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/config.cpp
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2023-10-24 14:54:26 +0200
committerGitHub <[email protected]>2023-10-24 14:54:26 +0200
commit1a144212278aa7158d6b32b63e398db95a7ae868 (patch)
tree58735827b0b706368a82bcaaa8aaa68f211e1d10 /src/zenserver/config.cpp
parentchunking moved to zenstore (#490) (diff)
downloadzen-1a144212278aa7158d6b32b63e398db95a7ae868.tar.xz
zen-1a144212278aa7158d6b32b63e398db95a7ae868.zip
merge disk and memory layers (#493)
- Feature: Added `--cache-memlayer-sizethreshold` option to zenserver to control at which size cache entries get cached in memory - Changed: Merged cache memory layer with cache disk layer to reduce memory and cpu overhead
Diffstat (limited to 'src/zenserver/config.cpp')
-rw-r--r--src/zenserver/config.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/zenserver/config.cpp b/src/zenserver/config.cpp
index e08d36583..81b1dcfe2 100644
--- a/src/zenserver/config.cpp
+++ b/src/zenserver/config.cpp
@@ -807,6 +807,9 @@ ParseConfigFile(const std::filesystem::path& Path,
ServerOptions.StructuredCacheConfig.EnableReferenceCaching,
"cache-reference-cache-enabled");
+ LuaOptions.AddOption("cache.memlayer.sizethreshold"sv,
+ ServerOptions.StructuredCacheConfig.MemCacheSizeThreshold,
+ "cache-memlayer-sizethreshold");
LuaOptions.AddOption("cache.memlayer.targetfootprint"sv,
ServerOptions.StructuredCacheConfig.MemTargetFootprintBytes,
"cache-memlayer-targetfootprint");
@@ -1182,6 +1185,14 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions)
cxxopts::value<bool>(ServerOptions.StructuredCacheConfig.EnableReferenceCaching)->default_value("false"),
"");
+ options.add_option(
+ "cache",
+ "",
+ "cache-memlayer-sizethreshold",
+ "The largest size of a cache entry that may be cached in memory. Default set to 1024 (1 Kb). Set to 0 to disable memory caching.",
+ cxxopts::value<uint64_t>(ServerOptions.StructuredCacheConfig.MemCacheSizeThreshold)->default_value("1024"),
+ "");
+
options.add_option("cache",
"",
"cache-memlayer-targetfootprint",