Make I/O and prefetch worker threads configurable

This commit is contained in:
Richard Holland
2021-11-22 13:47:21 +00:00
committed by Nik Bougalis
parent 6746b863b3
commit cf97dcb992
5 changed files with 41 additions and 3 deletions

View File

@@ -246,6 +246,10 @@ public:
#if RIPPLE_SINGLE_IO_SERVICE_THREAD
return 1;
#else
if (config.IO_WORKERS > 0)
return config.IO_WORKERS;
auto const cores = std::thread::hardware_concurrency();
// Use a single thread when running on under-provisioned systems
@@ -342,7 +346,8 @@ public:
m_collectorManager->collector(),
logs_->journal("Resource")))
, m_nodeStore(m_shaMapStore->makeNodeStore(4))
, m_nodeStore(m_shaMapStore->makeNodeStore(
config_->PREFETCH_WORKERS > 0 ? config_->PREFETCH_WORKERS : 4))
, nodeFamily_(*this, *m_collectorManager)