Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't use -dbcache for BDB anymore #2422

Merged
merged 1 commit into from
Mar 31, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions src/db.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,10 @@ bool CDBEnv::Open(const boost::filesystem::path& path)
if (GetBoolArg("-privdb", true))
nEnvFlags |= DB_PRIVATE;

unsigned int nDbCache = GetArg("-dbcache", 25);
dbenv.set_lg_dir(pathLogDir.string().c_str());
dbenv.set_cachesize(nDbCache / 1024, (nDbCache % 1024)*1048576, 1);
dbenv.set_lg_bsize(1048576);
dbenv.set_lg_max(10485760);
dbenv.set_cachesize(0, 0x100000, 1); // 1 MiB should be enough for just the wallet
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When would 1MB not be sufficient?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The wallet is always loaded entirely into RAM anyway, and only modified in small incremental ways, so a large cache shouldn't ever be needed. However, when BDB was still used for the block chain database, we did require large caches to speed up prevout lookups during block validation. That part is now in LevelDB anyway.

dbenv.set_lg_bsize(0x10000);
dbenv.set_lg_max(1048576);
dbenv.set_lk_max_locks(40000);
dbenv.set_lk_max_objects(40000);
dbenv.set_errfile(fopen(pathErrorFile.string().c_str(), "a")); /// debug
Expand Down