diff options
| author | Dan Engelbrecht <[email protected]> | 2022-12-02 16:56:51 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-12-02 07:56:51 -0800 |
| commit | 921078b38bfa91424c27ff707d950e26c18d3cd3 (patch) | |
| tree | e71446e3ebc29f7ff8ad47c0c23d8b2e49211dbe /zenserver/config.cpp | |
| parent | reduce gc log spam (INFO -> DEBUG) (#199) (diff) | |
| download | zen-921078b38bfa91424c27ff707d950e26c18d3cd3.tar.xz zen-921078b38bfa91424c27ff707d950e26c18d3cd3.zip | |
Size based gc trigger (#197)
- Feature: Disk size triggered GC, a soft disk usage limit for cache data.
- Feature: New option `--gc-disk-size-soft-limit` (command line), `gc.cache.disksizesoftlimit` (lua config) controlling limit for soft disk usage limit. Defaults to zero which disables soft disk usage limit.
- Improvement: Disk write pressure in GC log and cleaned up clutter in GC logging.
Diffstat (limited to 'zenserver/config.cpp')
| -rw-r--r-- | zenserver/config.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/zenserver/config.cpp b/zenserver/config.cpp index 9531a5251..057b26c5b 100644 --- a/zenserver/config.cpp +++ b/zenserver/config.cpp @@ -493,6 +493,14 @@ ParseCliOptions(int argc, char* argv[], ZenServerOptions& ServerOptions) "Garbage collection monitoring interval in seconds.", cxxopts::value<int32_t>(ServerOptions.GcConfig.MonitorIntervalSeconds)->default_value("30"), ""); + + options.add_option("gc", + "", + "gc-disksize-softlimit", + "Garbage collection disk usage soft limit. Default set to 0 (Off).", + cxxopts::value<uint64_t>(ServerOptions.GcConfig.Cache.DiskSizeSoftLimit)->default_value("0"), + ""); + try { auto result = options.parse(argc, argv); @@ -825,6 +833,7 @@ ParseConfigFile(const std::filesystem::path& Path, ZenServerOptions& ServerOptio ServerOptions.GcConfig.Cache.MaxDurationSeconds = CacheGcConfig.value().get_or("maxdurationseconds", int32_t(0)); ServerOptions.GcConfig.Cache.DiskSizeLimit = CacheGcConfig.value().get_or("disksizelimit", ~uint64_t(0)); ServerOptions.GcConfig.Cache.MemorySizeLimit = CacheGcConfig.value().get_or("memorysizelimit", ~uint64_t(0)); + ServerOptions.GcConfig.Cache.DiskSizeSoftLimit = CacheGcConfig.value().get_or("disksizesoftlimit", 0); } if (sol::optional<sol::table> CasGcConfig = GcConfig.value()["cas"]) |