Skip to content

Commit

Permalink
Do not create threadpools if we won't need them
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnSully committed Mar 1, 2024
1 parent c08683e commit 260f47b
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 260f47b

Please sign in to comment.