From 2c128d2ae07ede0eeab952c8585433988df0fe52 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Fri, 22 Mar 2013 08:09:37 -0700 Subject: [PATCH] Tune some other DB cache sizes. --- src/cpp/ripple/Application.cpp | 4 ++++ src/cpp/ripple/Config.cpp | 4 +++- src/cpp/ripple/Config.h | 4 +++- 3 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/cpp/ripple/Application.cpp b/src/cpp/ripple/Application.cpp index 7b5dd2191a..f62cb0632d 100644 --- a/src/cpp/ripple/Application.cpp +++ b/src/cpp/ripple/Application.cpp @@ -184,6 +184,10 @@ void Application::setup() theApp->getHashNodeDB()->getDB()->executeSQL(boost::str(boost::format("PRAGMA cache_size=-%d;") % (theConfig.getSize(siHashNodeDBCache) * 1024))); + theApp->getLedgerDB()->getDB()->executeSQL(boost::str(boost::format("PRAGMA cache_size=-%d;") % + (theConfig.getSize(siTxnDBCache) * 1024))); + theApp->getTxnDB()->getDB()->executeSQL(boost::str(boost::format("PRAGMA cache_size=-%d;") % + (theConfig.getSize(siLgrDBCache) * 1024))); // // Allow peer connections. diff --git a/src/cpp/ripple/Config.cpp b/src/cpp/ripple/Config.cpp index 8afef28738..096683d3f7 100644 --- a/src/cpp/ripple/Config.cpp +++ b/src/cpp/ripple/Config.cpp @@ -498,7 +498,9 @@ int Config::getSize(SizedItemName item) { siLineCacheSize, { 8192, 32768, 131072, 1048576, 0 } }, { siLineCacheAge, { 500, 600, 1800, 3600, 7200 } }, { siHashNodeDBCache, { 24, 48, 64, 128, 256 } }, - }; + { siTxnDBCache, { 4, 8, 32, 64, 128 } }, + { siLgrDBCache, { 4, 8, 32, 64, 128 } } + }; for (int i = 0; i < (sizeof(sizeTable) / sizeof(SizedItem)); ++i) { diff --git a/src/cpp/ripple/Config.h b/src/cpp/ripple/Config.h index 0ceceba598..f6e65856f5 100644 --- a/src/cpp/ripple/Config.h +++ b/src/cpp/ripple/Config.h @@ -65,7 +65,9 @@ enum SizedItemName siLedgerFetch, siLineCacheSize, siLineCacheAge, - siHashNodeDBCache + siHashNodeDBCache, + siTxnDBCache, + siLgrDBCache }; struct SizedItem