Auto merge of #2873 - bitcartel:2793_dbcache, r=bitcartel

Closes #2793 to improve sync performance by increasing default value of dbcache.
This commit is contained in:
Homu 2018-01-19 16:53:21 -08:00
commit 38246ea461
3 changed files with 16 additions and 2 deletions

View File

@ -0,0 +1,8 @@
In-memory caches
----------------
The size of some in-memory caches can be reduced. As caches trade off memory usage for performance, usually reducing these have a negative effect on performance.
- `-dbcache=<n>` - the UTXO database cache size, this defaults to `450` (`100` before 1.0.15). The unit is MiB (where 1 GiB = 1024 MiB).
- The minimum value for `-dbcache` is 4.
- A lower dbcache make initial sync time much longer. After the initial sync, the effect is less pronounced for most use-cases, unless fast validation of blocks is important such as for mining.

View File

@ -4,3 +4,9 @@ release-notes at release time)
Notable changes
===============
UTXO memory accounting
----------------------
The default -dbcache has been changed in this release to 450MiB. Users can set -dbcache to a higher value (e.g. to keep the UTXO set more fully cached in memory). Users on low-memory systems (such as systems with 1GB or less) should consider specifying a lower value for this parameter.
Additional information relating to running on low-memory systems can be found here: [reducing-memory-usage.md](https://github.com/zcash/zcash/blob/master/doc/reducing-memory-usage.md).

View File

@ -20,8 +20,8 @@ struct CDiskTxPos;
class uint256;
//! -dbcache default (MiB)
static const int64_t nDefaultDbCache = 100;
//! max. -dbcache in (MiB)
static const int64_t nDefaultDbCache = 450;
//! max. -dbcache (MiB)
static const int64_t nMaxDbCache = sizeof(void*) > 4 ? 16384 : 1024;
//! min. -dbcache in (MiB)
static const int64_t nMinDbCache = 4;