Adjust default number of threads for JobQueue:

The existing calculation would limit the maximum number of threads
that would be created by default to at most 6; this may have been
reasonable a few years ago, but given both the load on the network
as of today and the increase in the number of CPU cores, the value
should be revisited.

This commit, if merged, changes the default calculation for nodes
that are configured as `large` or `huge` to allow for up to twelve
threads.
This commit is contained in:
Nik Bougalis
2021-11-09 02:04:34 -08:00
parent eaff0d30fb
commit eb6b79bed7
8 changed files with 90 additions and 57 deletions

View File

@@ -637,7 +637,14 @@ Config::loadFromString(std::string const& fileContents)
}
if (getSingleSection(secConfig, SECTION_WORKERS, strTemp, j_))
WORKERS = beast::lexicalCastThrow<std::size_t>(strTemp);
{
WORKERS = beast::lexicalCastThrow<int>(strTemp);
if (WORKERS < 1 || WORKERS > 1024)
Throw<std::runtime_error>(
"Invalid " SECTION_WORKERS
": must be between 1 and 1024 inclusive.");
}
if (getSingleSection(secConfig, SECTION_COMPRESSION, strTemp, j_))
COMPRESSION = beast::lexicalCastThrow<bool>(strTemp);