From 01a4bb33de1381cd911daa6814779c1737f8cf5e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Botond=20D=C3=A9nes?= Date: Thu, 22 Apr 2021 09:26:22 +0300 Subject: [PATCH] database: increase semaphore max queue size Queued reads don't take 10KB (not even 1KB) for years now. But the real motivation of this patch is that due to a soon-to-come change to admission we expect larger queues especially in tests, so be more forgiving with queue sizes. --- database.hh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/database.hh b/database.hh index ab62df3b8b..50a1e6b4b0 100644 --- a/database.hh +++ b/database.hh @@ -1250,8 +1250,8 @@ private: ::cf_stats _cf_stats; static constexpr size_t max_count_concurrent_reads{100}; size_t max_memory_concurrent_reads() { return _dbcfg.available_memory * 0.02; } - // Assume a queued read takes up 10kB of memory, and allow 2% of memory to be filled up with such reads. - size_t max_inactive_queue_length() { return _dbcfg.available_memory * 0.02 / 10000; } + // Assume a queued read takes up 1kB of memory, and allow 2% of memory to be filled up with such reads. + size_t max_inactive_queue_length() { return _dbcfg.available_memory * 0.02 / 1000; } // They're rather heavyweight, so limit more static constexpr size_t max_count_streaming_concurrent_reads{10}; size_t max_memory_streaming_concurrent_reads() { return _dbcfg.available_memory * 0.02; }