diff options
author | Geert Bosch <geert@mongodb.com> | 2016-04-09 14:59:58 -0400 |
---|---|---|
committer | Geert Bosch <geert@mongodb.com> | 2016-04-09 14:59:58 -0400 |
commit | c5fcd8a55623a97e34879ec36d47dc1b1d675de5 (patch) | |
tree | ce0be387c0bc6cd0b32bd04f2ef8c3bc0d3e476d | |
parent | 4566c8ebffb803d5175e7f1b7aa5baeffcba795e (diff) | |
download | mongo-c5fcd8a55623a97e34879ec36d47dc1b1d675de5.tar.gz |
Revert "SERVER-23391 Lower WiredTiger cache size floor"
This reverts commit 5ee7b56b5b625dc62ef80ce4f5742ab837097567.
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp | 13 | ||||
-rw-r--r-- | src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp | 4 |
2 files changed, 7 insertions, 10 deletions
diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp index fffbf9c3fc9..5ccc1093549 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_init.cpp @@ -62,27 +62,24 @@ public: } size_t cacheSizeGB = wiredTigerGlobalOptions.cacheSizeGB; - size_t cacheSizeMB = 256; // minimum cache size if (cacheSizeGB == 0) { // Since the user didn't provide a cache size, choose a reasonable default value. // We want to reserve 1GB for the system and binaries, but it's not bad to // leave a fair amount left over for pagecache since that's compressed storage. - // If ProcessInfo indicates that there is < 2GB of memory, allocate 256M for cache. - // If ProcessInfo indicates exactly 2GB, allocate 614MB ProcessInfo pi; double memSizeMB = pi.getMemSizeMB(); - if (memSizeMB >= 1024 * 2) { + if (memSizeMB > 0) { double cacheMB = (memSizeMB - 1024) * 0.6; - cacheSizeMB = static_cast<size_t>(cacheMB); + cacheSizeGB = static_cast<size_t>(cacheMB / 1024); + if (cacheSizeGB < 1) + cacheSizeGB = 1; } - } else { - cacheSizeMB = 1024 * cacheSizeGB; } const bool ephemeral = false; WiredTigerKVEngine* kv = new WiredTigerKVEngine(getCanonicalName().toString(), params.dbpath, wiredTigerGlobalOptions.engineConfig, - cacheSizeMB, + cacheSizeGB, params.dur, ephemeral, params.repair, diff --git a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp index d8547c421f9..51749294c3d 100644 --- a/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp +++ b/src/mongo/db/storage/wiredtiger/wiredtiger_kv_engine.cpp @@ -171,7 +171,7 @@ TicketServerParameter openReadTransactionParam(&openReadTransaction, WiredTigerKVEngine::WiredTigerKVEngine(const std::string& canonicalName, const std::string& path, const std::string& extraOpenOptions, - size_t cacheSizeMB, + size_t cacheSizeGB, bool durable, bool ephemeral, bool repair, @@ -200,7 +200,7 @@ WiredTigerKVEngine::WiredTigerKVEngine(const std::string& canonicalName, std::stringstream ss; ss << "create,"; - ss << "cache_size=" << cacheSizeMB << "M,"; + ss << "cache_size=" << cacheSizeGB << "G,"; ss << "session_max=20000,"; ss << "eviction=(threads_max=4),"; ss << "config_base=false,"; |