mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-25 13:35:54 +00:00
Avoid the creation of large numbers of small LDB files.
This commit is contained in:
@@ -180,6 +180,7 @@ void Application::setup()
|
|||||||
options.filter_policy = leveldb::NewBloomFilterPolicy(10);
|
options.filter_policy = leveldb::NewBloomFilterPolicy(10);
|
||||||
if (theConfig.LDB_IMPORT)
|
if (theConfig.LDB_IMPORT)
|
||||||
options.write_buffer_size = 32 << 20;
|
options.write_buffer_size = 32 << 20;
|
||||||
|
options.write_buffer_size = std::max(options.write_buffer_size, theConfig.getSize(siLDBWriteSize) << 20);
|
||||||
leveldb::Status status = leveldb::DB::Open(options, (theConfig.DATA_DIR / "hashnode").string(), &mHashNodeLDB);
|
leveldb::Status status = leveldb::DB::Open(options, (theConfig.DATA_DIR / "hashnode").string(), &mHashNodeLDB);
|
||||||
if (!status.ok() || !mHashNodeLDB)
|
if (!status.ok() || !mHashNodeLDB)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -515,7 +515,8 @@ int Config::getSize(SizedItemName item)
|
|||||||
{ siLineCacheAge, { 500, 600, 1800, 3600, 7200 } },
|
{ siLineCacheAge, { 500, 600, 1800, 3600, 7200 } },
|
||||||
{ siHashNodeDBCache, { 24, 48, 64, 128, 256 } },
|
{ siHashNodeDBCache, { 24, 48, 64, 128, 256 } },
|
||||||
{ siTxnDBCache, { 4, 12, 48, 96, 192 } },
|
{ siTxnDBCache, { 4, 12, 48, 96, 192 } },
|
||||||
{ siLgrDBCache, { 4, 8, 32, 64, 128 } }
|
{ siLgrDBCache, { 4, 8, 32, 64, 128 } },
|
||||||
|
{ siLDBWriteSize, { 8, 16, 32, 64, 128 } }
|
||||||
};
|
};
|
||||||
|
|
||||||
for (int i = 0; i < (sizeof(sizeTable) / sizeof(SizedItem)); ++i)
|
for (int i = 0; i < (sizeof(sizeTable) / sizeof(SizedItem)); ++i)
|
||||||
|
|||||||
@@ -67,7 +67,8 @@ enum SizedItemName
|
|||||||
siLineCacheAge,
|
siLineCacheAge,
|
||||||
siHashNodeDBCache,
|
siHashNodeDBCache,
|
||||||
siTxnDBCache,
|
siTxnDBCache,
|
||||||
siLgrDBCache
|
siLgrDBCache,
|
||||||
|
siLDBWriteSize
|
||||||
};
|
};
|
||||||
|
|
||||||
struct SizedItem
|
struct SizedItem
|
||||||
|
|||||||
Reference in New Issue
Block a user