From 260f47bbb5b30beebba2f9dc1fff520cabd94e6f Mon Sep 17 00:00:00 2001 From: John Sully Date: Fri, 1 Mar 2024 22:19:25 +0000 Subject: [PATCH] Do not create threadpools if we won't need them --- src/server.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/server.cpp b/src/server.cpp index 4a42df649..a14e4a9ce 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -4159,10 +4159,15 @@ void InitServerLast() { g_pserver->asyncworkqueue = new (MALLOC_LOCAL) AsyncWorkQueue(cserver.cthreads); - g_pserver->asyncreadworkqueue = new (MALLOC_LOCAL) AsyncWorkQueue(cserver.cthreads*10); + if (g_pserver->m_pstorageFactory != nullptr) { + g_pserver->asyncreadworkqueue = new (MALLOC_LOCAL) AsyncWorkQueue(cserver.cthreads); - //Process one write/commit at a time to ensure consistency - g_pserver->asyncwriteworkqueue = new (MALLOC_LOCAL) AsyncWorkQueue(1); + //Process one write/commit at a time to ensure consistency + g_pserver->asyncwriteworkqueue = new (MALLOC_LOCAL) AsyncWorkQueue(1); + } else { + g_pserver->asyncreadworkqueue = nullptr; + g_pserver->asyncwriteworkqueue = nullptr; + } // Allocate the repl backlog