From fc5a0078b086c407c18e08842c78f713e8393bb9 Mon Sep 17 00:00:00 2001 From: Anthony Fieroni Date: Tue, 9 Jun 2020 16:21:26 +0300 Subject: [PATCH] Increase default db cache, optimize db before sync Signed-off-by: Anthony Fieroni --- src/claimtrie/trie.cpp | 1 + src/txdb.h | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/claimtrie/trie.cpp b/src/claimtrie/trie.cpp index 5b614b393..4fd229a78 100644 --- a/src/claimtrie/trie.cpp +++ b/src/claimtrie/trie.cpp @@ -155,6 +155,7 @@ CClaimTrieCacheBase::~CClaimTrieCacheBase() bool CClaimTrie::SyncToDisk() { + db << "PRAGMA optimize"; // alternatively, switch to full sync after we are caught up on the chain return sqlite::sync(db) == SQLITE_OK; } diff --git a/src/txdb.h b/src/txdb.h index 51dbcf9f6..d1deb3004 100644 --- a/src/txdb.h +++ b/src/txdb.h @@ -58,7 +58,7 @@ class uint256; //! No need to periodic flush if at least this much space still available. static constexpr int MAX_BLOCK_COINSDB_USAGE = 10; //! -dbcache default (MiB) -static const int64_t nDefaultDbCache = 480; +static const int64_t nDefaultDbCache = 4096; //! -dbbatchsize default (bytes) static const int64_t nDefaultDbBatchSize = 16 << 20; //! max. -dbcache (MiB)