From b47d04861af6fc65cbd6b817ab9fd203053ba12f Mon Sep 17 00:00:00 2001 From: Tudor Malene Date: Mon, 15 Jul 2024 09:53:23 +0100 Subject: [PATCH] tweak cache config --- go/enclave/storage/cache_service.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/go/enclave/storage/cache_service.go b/go/enclave/storage/cache_service.go index 8982434aa6..db3df207ab 100644 --- a/go/enclave/storage/cache_service.go +++ b/go/enclave/storage/cache_service.go @@ -62,9 +62,8 @@ type CacheService struct { func NewCacheService(logger gethlog.Logger) *CacheService { // todo (tudor) figure out the config ristrettoCache, err := ristretto.NewCache(&ristretto.Config{ - NumCounters: 100_000_000, // 10 times the expected elements - MaxCost: 1024 * 1024 * 1024, // allocate 1GB - BufferItems: 64, // number of keys per Get buffer. + NumCounters: 10 * 10 * 1000, // 10 times the expected elements (10 caches * 1000 historic elements) + MaxCost: 512 * 1024 * 1024, // allocate 512MB }) if err != nil { logger.Crit("Could not initialise ristretto cache", log.ErrKey, err)