aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-05-30 14:45:11 +0200
committerGitHub Enterprise <[email protected]>2024-05-30 14:45:11 +0200
commit1d78cdb86ddb8eb050d2f7cd97c82974b854ca90 (patch)
tree6cefc5d2908f9ed49225844ca4d9982a7e6bec6e
parentcache optimizations (#88) (diff)
downloadzen-1d78cdb86ddb8eb050d2f7cd97c82974b854ca90.tar.xz
zen-1d78cdb86ddb8eb050d2f7cd97c82974b854ca90.zip
Use a smaller thread pool for network operations when doing oplog import to reduce risk NIC/router failure (#89)
Medium worker pool now uses a minimum of 2 threads (up from 1)
-rw-r--r--CHANGELOG.md2
-rw-r--r--src/zenserver/projectstore/remoteprojectstore.cpp2
-rw-r--r--src/zenutil/workerpools.cpp2
3 files changed, 4 insertions, 2 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 0bde2a3f8..ccd78ca7a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -80,6 +80,8 @@
- Improvement: Asserts flushes the log before sending error report to Sentry
- Improvement: Refactored IterateChunks to allow reuse in diskcachelayer and hide public GetBlockFile() function in BlockStore
- Improvement: Don't use "error:" in log messages unless there is an error as Horde CI will pick up that log line and interpret it as an error
+- Improvement: Use a smaller thread pool for network operations when doing oplog import to reduce risk NIC/router failure
+- Improvement: Medium worker pool now uses a minimum of 2 threads (up from 1)
## 5.4.5
- Bugfix: If we get a request for a partial chunk that can not be fulfilled we warn and treat it as a miss
diff --git a/src/zenserver/projectstore/remoteprojectstore.cpp b/src/zenserver/projectstore/remoteprojectstore.cpp
index 42c93f7cd..de6753a6b 100644
--- a/src/zenserver/projectstore/remoteprojectstore.cpp
+++ b/src/zenserver/projectstore/remoteprojectstore.cpp
@@ -2372,7 +2372,7 @@ LoadOplog(CidStore& ChunkStore,
Stopwatch Timer;
WorkerThreadPool& WorkerPool = GetLargeWorkerPool();
- WorkerThreadPool& NetworkWorkerPool = GetMediumWorkerPool();
+ WorkerThreadPool& NetworkWorkerPool = GetSmallWorkerPool();
std::unordered_set<IoHash, IoHash::Hasher> Attachments;
uint64_t BlockCountToDownload = 0;
diff --git a/src/zenutil/workerpools.cpp b/src/zenutil/workerpools.cpp
index 939f3a1c4..144ef6817 100644
--- a/src/zenutil/workerpools.cpp
+++ b/src/zenutil/workerpools.cpp
@@ -12,7 +12,7 @@ ZEN_THIRD_PARTY_INCLUDES_END
namespace zen {
namespace {
const int LargeWorkerThreadPoolTreadCount = gsl::narrow<int>(std::thread::hardware_concurrency());
- const int MediumWorkerThreadPoolTreadCount = gsl::narrow<int>(Max((std::thread::hardware_concurrency() / 4u), 1u));
+ const int MediumWorkerThreadPoolTreadCount = gsl::narrow<int>(Max((std::thread::hardware_concurrency() / 4u), 2u));
const int SmallWorkerThreadPoolTreadCount = gsl::narrow<int>(Max((std::thread::hardware_concurrency() / 8u), 1u));
static bool IsShutDown = false;