diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2012-03-29 10:13:42 -0700 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2012-03-29 10:13:42 -0700 |
commit | 83e914c1d5a0d46461bbc04ad0224ff7151fb323 (patch) | |
tree | 9e0e6b9eb3bbb2d195d4d350af837ba6a013b7f9 | |
parent | 94b5960ef3894318adcddafd1ac91f1eacc1f27c (diff) | |
parent | 9f18347034236703deffda9107248e565988439f (diff) |
Merge pull request #1007 from gavinandresen/log_auto_remove
Auto-remove logs, and decrease logfile size to 10M
-rw-r--r-- | src/db.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/db.cpp b/src/db.cpp index c18860afcc..2dc86e79fa 100644 --- a/src/db.cpp +++ b/src/db.cpp @@ -87,12 +87,13 @@ CDB::CDB(const char* pszFile, const char* pszMode) : pdb(NULL) int nDbCache = GetArg("-dbcache", 25); dbenv.set_lg_dir(strLogDir.c_str()); dbenv.set_cachesize(nDbCache / 1024, (nDbCache % 1024)*1048576, 1); - dbenv.set_lg_bsize(10485760); - dbenv.set_lg_max(104857600); + dbenv.set_lg_bsize(1048576); + dbenv.set_lg_max(10485760); dbenv.set_lk_max_locks(10000); dbenv.set_lk_max_objects(10000); dbenv.set_errfile(fopen(strErrorFile.c_str(), "a")); /// debug dbenv.set_flags(DB_AUTO_COMMIT, 1); + dbenv.log_set_config(DB_LOG_AUTO_REMOVE, 1); ret = dbenv.open(strDataDir.c_str(), DB_CREATE | DB_INIT_LOCK | |