From 69860654f903aaff07bc9b4685bb46ac29e4144d Mon Sep 17 00:00:00 2001 From: yihuang Date: Fri, 26 Jul 2024 17:53:53 +0800 Subject: [PATCH] Problem: block cache size not count in index/filters (backport #1531) Solution: - increase block cache size --- cmd/cronosd/opendb/opendb_rocksdb.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cmd/cronosd/opendb/opendb_rocksdb.go b/cmd/cronosd/opendb/opendb_rocksdb.go index bcb0401c22..4b3b4fe800 100644 --- a/cmd/cronosd/opendb/opendb_rocksdb.go +++ b/cmd/cronosd/opendb/opendb_rocksdb.go @@ -13,7 +13,8 @@ import ( "github.com/linxGnu/grocksdb" ) -const BlockCacheSize = 1 << 30 +// 3G block cache +const BlockCacheSize = 3 << 30 func OpenDB(_ types.AppOptions, home string, backendType dbm.BackendType) (dbm.DB, error) { dataDir := filepath.Join(home, "data") @@ -98,7 +99,6 @@ func NewRocksdbOptions(opts *grocksdb.Options, sstFileWriter bool) *grocksdb.Opt // block based table options bbto := grocksdb.NewDefaultBlockBasedTableOptions() - // 1G block cache bbto.SetBlockCache(grocksdb.NewLRUCache(BlockCacheSize)) // http://rocksdb.org/blog/2021/12/29/ribbon-filter.html