File tree Expand file tree Collapse file tree 2 files changed +6
-2
lines changed
Expand file tree Collapse file tree 2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -84,8 +84,11 @@ CDB::CDB(const char* pszFile, const char* pszMode) : pdb(NULL)
8484 string strErrorFile = strDataDir + " /db.log" ;
8585 printf (" dbenv.open strLogDir=%s strErrorFile=%s\n " , strLogDir.c_str (), strErrorFile.c_str ());
8686
87+ int nDbCache = GetArg (" -dbcache" , 25 );
8788 dbenv.set_lg_dir (strLogDir.c_str ());
88- dbenv.set_lg_max (10000000 );
89+ dbenv.set_cachesize (nDbCache / 1024 , (nDbCache % 1024 )*1048576 , 1 );
90+ dbenv.set_lg_bsize (10485760 );
91+ dbenv.set_lg_max (104857600 );
8992 dbenv.set_lk_max_locks (10000 );
9093 dbenv.set_lk_max_objects (10000 );
9194 dbenv.set_errfile (fopen (strErrorFile.c_str (), " a" )); // / debug
@@ -156,7 +159,7 @@ void CDB::Close()
156159 nMinutes = 1 ;
157160 if (strFile == " addr.dat" )
158161 nMinutes = 2 ;
159- if (strFile == " blkindex.dat" && IsInitialBlockDownload () && nBestHeight % 500 != 0 )
162+ if (strFile == " blkindex.dat" && IsInitialBlockDownload () && nBestHeight % 5000 != 0 )
160163 nMinutes = 1 ;
161164 dbenv.txn_checkpoint (0 , nMinutes, 0 );
162165
Original file line number Diff line number Diff line change @@ -177,6 +177,7 @@ bool AppInit2(int argc, char* argv[])
177177 " -min \t\t " + _ (" Start minimized" ) + " \n " +
178178 " -splash \t\t " + _ (" Show splash screen on startup (default: 1)" ) + " \n " +
179179 " -datadir=<dir> \t\t " + _ (" Specify data directory" ) + " \n " +
180+ " -dbcache=<n> \t\t " + _ (" Set database cache size in megabytes (default: 25)" ) + " \n " +
180181 " -timeout=<n> \t " + _ (" Specify connection timeout (in milliseconds)" ) + " \n " +
181182 " -proxy=<ip:port> \t " + _ (" Connect through socks4 proxy" ) + " \n " +
182183 " -dns \t " + _ (" Allow DNS lookups for addnode and connect" ) + " \n " +
You can’t perform that action at this time.
0 commit comments