lower addrContractsCacheAlwaysSize to 600 000

This commit is contained in:
pragmaxim
2026-02-06 13:31:19 +01:00
parent 5189c60f30
commit 4a36bec3c5
3 changed files with 2 additions and 5 deletions

View File

@@ -58,7 +58,7 @@ const (
)
const addrContractsCacheMinSize = 300_000 // limit for caching address contracts in memory to speed up indexing
const addrContractsCacheAlwaysSize = 1_000_000
const addrContractsCacheAlwaysSize = 600_000
const addrContractsCacheHotMinScore = 2.0
const addrContractsHotHalfLife = 45 * time.Minute
const addrContractsHotEvictAfter = 8 * time.Hour

View File

@@ -2147,9 +2147,6 @@ func (d *RocksDB) logAddrContractsCacheMetrics(period time.Duration) {
flushes := atomic.SwapUint64(&d.addrContractsCacheState.cacheFlushes, 0)
total := hits + misses
if total == 0 && writes == 0 && cacheWrites == 0 && skipped == 0 && flushes == 0 {
return
}
hitRate := 0.0
if total > 0 {
hitRate = float64(hits) * 100 / float64(total)

View File

@@ -14,7 +14,7 @@ Some behavior of Blockbook can be modified by environment variables. The variabl
Default: `300000`
Description: Minimum packed size (bytes) to consider addressContracts hotness/caching. Accepts bytes or `K/M/G/T` suffixes (e.g. `300000`, `300K`, `1MiB`).
- `<coin shortcut>_ADDR_CONTRACTS_CACHE_ALWAYS_SIZE`
Default: `1000000`
Default: `600000`
Description: Always cache addressContracts above this packed size (bytes). Accepts bytes or `K/M/G/T` suffixes.
- `<coin shortcut>_ADDR_CONTRACTS_CACHE_HOT_MIN_SCORE`
Default: `2`