aboutsummaryrefslogtreecommitdiff
path: root/src/zenstore/include
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2024-09-27 14:54:28 +0200
committerGitHub Enterprise <[email protected]>2024-09-27 14:54:28 +0200
commit59f920075f2efa7bb2c015d7da2a706413c68383 (patch)
treeaa69b9facb661496382ab60c466d62304b9ac671 /src/zenstore/include
parentAdd instructions to README.md for upgrading third party libraries (#173) (diff)
downloadzen-59f920075f2efa7bb2c015d7da2a706413c68383.tar.xz
zen-59f920075f2efa7bb2c015d7da2a706413c68383.zip
reduce lock time for memcache trim (#171)
- Improvement: Faster memcache trimming - Reduce calculations while holding bucket lock for memcache trim analysis to reduce contention - When trimming memcache, evict 25% more than required to reduce frequency of trimming - When trimming memcache, don't repack memcache data vector, defer that to regular garbage collection - When trimming memcache, deallocate memcache buffers when not holding exclusive lock in bucket
Diffstat (limited to 'src/zenstore/include')
-rw-r--r--src/zenstore/include/zenstore/cache/cachedisklayer.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/zenstore/include/zenstore/cache/cachedisklayer.h b/src/zenstore/include/zenstore/cache/cachedisklayer.h
index 8e31d3222..6d85e8039 100644
--- a/src/zenstore/include/zenstore/cache/cachedisklayer.h
+++ b/src/zenstore/include/zenstore/cache/cachedisklayer.h
@@ -420,7 +420,7 @@ public:
}
static inline uint64_t EstimateMemCachePayloadMemory(uint64_t PayloadSize)
{
- return sizeof(MemCacheData) + sizeof(IoBufferCore) + RoundUp(PayloadSize, 8u);
+ return sizeof(IoBufferCore) + RoundUp(PayloadSize, 8u);
}
// These locks are here to avoid contention on file creation, therefore it's sufficient
@@ -464,10 +464,11 @@ private:
return;
}
- MemCacheTrim();
+ StartAsyncMemCacheTrim();
}
- void MemCacheTrim();
uint64_t MemCacheTrim(std::vector<CacheBucket*>& Buckets, GcClock::TimePoint ExpireTime);
+ bool StartAsyncMemCacheTrim();
+ void MemCacheTrim();
GcManager& m_Gc;
JobQueue& m_JobQueue;