aboutsummaryrefslogtreecommitdiff
path: root/src/zenserver/config.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/zenserver/config.cpp')
-rw-r--r--src/zenserver/config.cpp39
1 files changed, 34 insertions, 5 deletions
diff --git a/src/zenserver/config.cpp b/src/zenserver/config.cpp
index 6daf7fe1c..5e24d174b 100644
--- a/src/zenserver/config.cpp
+++ b/src/zenserver/config.cpp
@@ -814,9 +814,17 @@ ParseConfigFile(const std::filesystem::path& Path,
LuaOptions.AddOption("trace.file"sv, ServerOptions.TraceFile, "tracefile"sv);
////// cache
- LuaOptions.AddOption("cache.enable"sv, ServerOptions.StructuredCacheEnabled);
- LuaOptions.AddOption("cache.writelog"sv, ServerOptions.StructuredCacheWriteLogEnabled);
- LuaOptions.AddOption("cache.accesslog"sv, ServerOptions.StructuredCacheAccessLogEnabled);
+ LuaOptions.AddOption("cache.enable"sv, ServerOptions.StructuredCacheConfig.Enabled);
+ LuaOptions.AddOption("cache.writelog"sv, ServerOptions.StructuredCacheConfig.WriteLogEnabled, "cache-write-log");
+ LuaOptions.AddOption("cache.accesslog"sv, ServerOptions.StructuredCacheConfig.AccessLogEnabled, "cache-access-log");
+
+ LuaOptions.AddOption("cache.memlayer.targetfootprint"sv,
+ ServerOptions.StructuredCacheConfig.MemTargetFootprintBytes,
+ "cache-memlayer-targetfootprint");
+ LuaOptions.AddOption("cache.memlayer.triminterval"sv,
+ ServerOptions.StructuredCacheConfig.MemTrimIntervalSeconds,
+ "cache-memlayer-triminterval");
+ LuaOptions.AddOption("cache.memlayer.maxage"sv, ServerOptions.StructuredCacheConfig.MemMaxAgeSeconds, "cache-memlayer-maxage");
////// cache.upstream
LuaOptions.AddOption("cache.upstream.policy"sv, ServerOptions.UpstreamCacheConfig.CachePolicy, "upstream-cache-policy"sv);
@@ -1236,14 +1244,35 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions)
"",
"cache-write-log",
"Whether cache write log is enabled",
- cxxopts::value<bool>(ServerOptions.StructuredCacheWriteLogEnabled)->default_value("true"),
+ cxxopts::value<bool>(ServerOptions.StructuredCacheConfig.WriteLogEnabled)->default_value("true"),
"");
options.add_option("cache",
"",
"cache-access-log",
"Whether cache access log is enabled",
- cxxopts::value<bool>(ServerOptions.StructuredCacheAccessLogEnabled)->default_value("true"),
+ cxxopts::value<bool>(ServerOptions.StructuredCacheConfig.AccessLogEnabled)->default_value("true"),
+ "");
+
+ options.add_option("cache",
+ "",
+ "cache-memlayer-targetfootprint",
+ "Max allowed memory used by cache memory layer per namespace in bytes. Default set to 536870912 (512 Mb).",
+ cxxopts::value<uint64_t>(ServerOptions.StructuredCacheConfig.MemTargetFootprintBytes)->default_value("536870912"),
+ "");
+
+ options.add_option("cache",
+ "",
+ "cache-memlayer-triminterval",
+ "Minimum time between each attempt to trim cache memory layers in seconds. Default set to 60 (1 min).",
+ cxxopts::value<uint64_t>(ServerOptions.StructuredCacheConfig.MemTrimIntervalSeconds)->default_value("60"),
+ "");
+
+ options.add_option("cache",
+ "",
+ "cache-memlayer-maxage",
+ "Maximum age of payloads when trimming cache memory layers in seconds. Default set to 86400 (1 day).",
+ cxxopts::value<uint64_t>(ServerOptions.StructuredCacheConfig.MemMaxAgeSeconds)->default_value("86400"),
"");
options.add_option("compute",