From 2ca4e1c088b6726d44c6f475ff1106374444b1a2 Mon Sep 17 00:00:00 2001 From: Dan Engelbrecht Date: Wed, 9 Oct 2024 09:40:59 +0200 Subject: don't read chunks into memory during cache batch fetch unless we may cache them in memory (#188) * Don't read chunks into memory during cache batch fetch unless we may cache them in memory --- src/zenstore/cache/cachedisklayer.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/zenstore/cache/cachedisklayer.cpp') diff --git a/src/zenstore/cache/cachedisklayer.cpp b/src/zenstore/cache/cachedisklayer.cpp index 8a2de34e2..9161905d7 100644 --- a/src/zenstore/cache/cachedisklayer.cpp +++ b/src/zenstore/cache/cachedisklayer.cpp @@ -1503,7 +1503,8 @@ ZenCacheDiskLayer::CacheBucket::EndGetBatch(GetBatchHandle* Batch) noexcept { ZEN_TRACE_CPU("Z$::Bucket::EndGetBatch::ReadInline"); m_BlockStore.IterateChunks(InlineBlockLocations, [&](uint32_t, std::span ChunkIndexes) -> bool { - const uint64_t LargeChunkSizeLimit = Max(m_Configuration.MemCacheSizeThreshold, 32u * 1024u); + // Only read into memory the IoBuffers we could potentially add to memcache + const uint64_t LargeChunkSizeLimit = Max(m_Configuration.MemCacheSizeThreshold, 1u * 1024u); m_BlockStore.IterateBlock( InlineBlockLocations, ChunkIndexes, -- cgit v1.2.3