Skip to content

Commit

Permalink
adjust cache cfg
Browse files Browse the repository at this point in the history
  • Loading branch information
tudor-malene committed Oct 2, 2023
1 parent a030959 commit 48eaed5
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion go/enclave/storage/storage.go
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,9 @@ func NewStorage(backingDB enclavedb.EnclaveDB, chainConfig *params.ChainConfig,

// todo (tudor) figure out the context and the config
cfg := bigcache.DefaultConfig(2 * time.Minute)
cfg.HardMaxCacheSize = 512
cfg.Shards = 512
// 1GB cache. Max value in a shard is 2MB. No batch or block should be larger than that
cfg.HardMaxCacheSize = cfg.Shards * 4
bigcacheClient, err := bigcache.New(context.Background(), cfg)
if err != nil {
logger.Crit("Could not initialise bigcache", log.ErrKey, err)
Expand Down

0 comments on commit 48eaed5

Please sign in to comment.