diff options
author | Monica Ng <monica.ng@mongodb.com> | 2021-05-12 05:07:52 +0000 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2021-05-14 00:45:26 +0000 |
commit | 310b02cfa32df40d2c31d9f8c5852ae2e66b7d1e (patch) | |
tree | 171efb0a097c0b3dd5d7e428c53d550736d0e6b0 | |
parent | e1abfabc5aef75efdded002aef74914ddb47392b (diff) | |
download | mongo-310b02cfa32df40d2c31d9f8c5852ae2e66b7d1e.tar.gz |
SERVER-56508 Ability to customise Zstandard compression level
SERVER-56508 Ability to customise Zstandard compression level
3 files changed, 12 insertions, 0 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_global_options.h b/src/mongo/db/storage/wiredtiger/wiredtiger_global_options.h index 51546164c39..ab361dd2d79 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_global_options.h +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_global_options.h @@ -51,6 +51,7 @@ public: double cacheSizeGB; size_t statisticsLogDelaySecs; std::string journalCompressor; + int zstdCompressorLevel; bool directoryForIndexes; double maxCacheOverflowFileSizeGBDeprecated; std::string engineConfig; diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_global_options.idl b/src/mongo/db/storage/wiredtiger/wiredtiger_global_options.idl index dc66b0f6e5c..0bb80353ea2 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_global_options.idl +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_global_options.idl @@ -59,6 +59,15 @@ configs: gte: 0 lte: 100000 default: 0 + "storage.wiredTiger.engineConfig.zstdCompressionLevel": + description: 'Default compression level for zstandard compressor' + arg_vartype: Int + cpp_varname: 'wiredTigerGlobalOptions.zstdCompressorLevel' + short_name: zstdDefaultCompressionLevel + validator: + gte: -5 + lte: 22 + default: 6 "storage.wiredTiger.engineConfig.journalCompressor": description: 'Use a compressor for log records [none|snappy|zlib|zstd]' arg_vartype: String diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp index 4928a296daa..78943ba20df 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp @@ -364,6 +364,8 @@ WiredTigerKVEngine::WiredTigerKVEngine(const std::string& canonicalName, ss << "log=(enabled=true,archive=" << (_readOnly ? "false" : "true") << ",path=journal,compressor="; ss << wiredTigerGlobalOptions.journalCompressor << "),"; + ss << "builtin_extension_config=(zstd=(compression_level=" + << wiredTigerGlobalOptions.zstdCompressorLevel << ")),"; ss << "file_manager=(close_idle_time=" << gWiredTigerFileHandleCloseIdleTime << ",close_scan_interval=" << gWiredTigerFileHandleCloseScanInterval << ",close_handle_minimum=" << gWiredTigerFileHandleCloseMinimum << "),"; |