From dea064712b278a7cd14323f96745f9b06bbca6eb Mon Sep 17 00:00:00 2001 From: John Sully Date: Tue, 16 Feb 2021 21:07:43 +0000 Subject: [PATCH] Disable async rehash with single threads, it causes slowdowns as the rehash never completes Former-commit-id: 5d08dbdf76c0fd1e0cfcf86b97ef3e656f0e4f5d --- src/server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/server.cpp b/src/server.cpp index eda89bc0e..a006d4da0 100644 --- a/src/server.cpp +++ b/src/server.cpp @@ -1950,7 +1950,7 @@ void databasesCron(bool fMainThread) { ::dict *dict = g_pserver->db[rehash_db]->dictUnsafeKeyOnly(); /* Are we async rehashing? And if so is it time to re-calibrate? */ /* The recalibration limit is a prime number to ensure balancing across threads */ - if (rehashes_per_ms > 0 && async_rehashes < 131 && !cserver.active_defrag_enabled) { + if (rehashes_per_ms > 0 && async_rehashes < 131 && !cserver.active_defrag_enabled && cserver.cthreads > 1) { serverTL->rehashCtl = dictRehashAsyncStart(dict, rehashes_per_ms); ++async_rehashes; }