Module redis

Module redis 

Source
Expand description

Proactive Redis eviction manager.

Provides intelligent eviction before Redis LRU kicks in, protecting infrastructure keys (merkle trees, indexes) while evicting data keys based on access patterns and memory pressure.

Uses the same tan-curve scoring algorithm as L1 memory eviction.

§Strategy

┌─────────────────────────────────────────────────────────────┐
│  Layer 1: Proactive Tan-Curve (sync-engine managed)        │
│  └─ Score = f(last_access, access_count, size, pressure)   │
│  └─ Protected: merkle:*, idx:*, RediSearch indexes         │
│  └─ Evict lowest-scoring data keys first                   │
├─────────────────────────────────────────────────────────────┤
│  Layer 2: Redis LRU (emergency fallback)                   │
│  └─ Only kicks in if proactive eviction miscalculates      │
│  └─ maxmemory-policy: allkeys-lru                          │
└─────────────────────────────────────────────────────────────┘

Structs§

RedisEvictionConfig
Configuration for Redis eviction.
RedisEvictionManager
Proactive Redis eviction manager.
RedisEvictionStats
Statistics for monitoring Redis eviction state.
RedisKeyMeta
Metadata for a tracked Redis key (for eviction scoring).
RedisMemoryProfile
Cached Redis memory profile to avoid round-trips.