File tree Expand file tree Collapse file tree 3 files changed +27
-7
lines changed Expand file tree Collapse file tree 3 files changed +27
-7
lines changed Original file line number Diff line number Diff line change @@ -41,9 +41,21 @@ report issues about Windows XP to the issue tracker.
41
41
Notable changes
42
42
===============
43
43
44
- Example item
45
- ----------------
44
+ Database cache memory increased
45
+ --------------------------------
46
+
47
+ As a result of growth of the UTXO set, performance with the prior default
48
+ database cache of 100 MiB has suffered.
49
+ For this reason the default was changed to 300 MiB in this release.
50
+
51
+ For nodes on low-memory systems, the database cache can be changed back to
52
+ 100 MiB (or to another value) by either:
53
+
54
+ - Adding ` dbcache=100 ` in bitcoin.conf
55
+ - Changing it in the GUI under ` Options → Size of database cache `
46
56
57
+ Note that the database cache setting has the most performance impact
58
+ during initial sync of a node, and when catching up after downtime.
47
59
48
60
bitcoin-cli: arguments privacy
49
61
--------------------------------
Original file line number Diff line number Diff line change @@ -1216,10 +1216,10 @@ bool AppInit2(boost::thread_group& threadGroup, CScheduler& scheduler)
1216
1216
nTotalCache = std::max (nTotalCache, nMinDbCache << 20 ); // total cache cannot be less than nMinDbCache
1217
1217
nTotalCache = std::min (nTotalCache, nMaxDbCache << 20 ); // total cache cannot be greated than nMaxDbcache
1218
1218
int64_t nBlockTreeDBCache = nTotalCache / 8 ;
1219
- if (nBlockTreeDBCache > (1 << 21 ) && !GetBoolArg (" -txindex" , DEFAULT_TXINDEX))
1220
- nBlockTreeDBCache = (1 << 21 ); // block tree db cache shouldn't be larger than 2 MiB
1219
+ nBlockTreeDBCache = std::min (nBlockTreeDBCache, (GetBoolArg (" -txindex" , DEFAULT_TXINDEX) ? nMaxBlockDBAndTxIndexCache : nMaxBlockDBCache) << 20 );
1221
1220
nTotalCache -= nBlockTreeDBCache;
1222
1221
int64_t nCoinDBCache = std::min (nTotalCache / 2 , (nTotalCache / 4 ) + (1 << 23 )); // use 25%-50% of the remainder for disk cache
1222
+ nCoinDBCache = std::min (nCoinDBCache, nMaxCoinsDBCache << 20 ); // cap total coins db cache
1223
1223
nTotalCache -= nCoinDBCache;
1224
1224
nCoinCacheUsage = nTotalCache; // the rest goes to in-memory cache
1225
1225
LogPrintf (" Cache configuration:\n " );
Original file line number Diff line number Diff line change @@ -22,11 +22,19 @@ class CCoinsViewDBCursor;
22
22
class uint256 ;
23
23
24
24
// ! -dbcache default (MiB)
25
- static const int64_t nDefaultDbCache = 100 ;
26
- // ! max. -dbcache in (MiB)
25
+ static const int64_t nDefaultDbCache = 300 ;
26
+ // ! max. -dbcache (MiB)
27
27
static const int64_t nMaxDbCache = sizeof (void *) > 4 ? 16384 : 1024 ;
28
- // ! min. -dbcache in (MiB)
28
+ // ! min. -dbcache (MiB)
29
29
static const int64_t nMinDbCache = 4 ;
30
+ // ! Max memory allocated to block tree DB specific cache, if no -txindex (MiB)
31
+ static const int64_t nMaxBlockDBCache = 2 ;
32
+ // ! Max memory allocated to block tree DB specific cache, if -txindex (MiB)
33
+ // Unlike for the UTXO database, for the txindex scenario the leveldb cache make
34
+ // a meaningful difference: https://github.com/bitcoin/bitcoin/pull/8273#issuecomment-229601991
35
+ static const int64_t nMaxBlockDBAndTxIndexCache = 1024 ;
36
+ // ! Max memory allocated to coin DB specific cache (MiB)
37
+ static const int64_t nMaxCoinsDBCache = 8 ;
30
38
31
39
struct CDiskTxPos : public CDiskBlockPos
32
40
{
You can’t perform that action at this time.
0 commit comments