When migrating from a per-object heap allocator (stock Redis 7.2 or Valkey) to Engula's compact block storage kernel, the most common operational pitfall is applying legacy allocator-byte or static fragmentation heuristics to packed memory blocks. This guide explains how to read physical vs. logical memory metrics on Engula 2.3.0, how eviction utilization is calculated, and how to size host and Kubernetes container memory limits safely.
On Engula, OS-level physical resident footprint and intra-block payload utilization are reported across two complementary commands:
| Command & Field | Physical / Logical Meaning | Production Accounting Rule |
|---|---|---|
INFO memory → used_memory_rss |
Actual OS physical resident memory (RSS) mapped by the engula-server process |
Authoritative metric for RAM savings, shard consolidation ratios, and host memory utilization |
INFO memory → used_memory |
Allocator-accounted bytes (includes active mutable-block headroom and tombstoned records awaiting background compaction) | Governs maxmemory eviction alongside mem_not_counted_for_evict; does not equal net compressed payload bytes |
INFO memory → mem_not_counted_for_evict |
Replication backlog and replica output buffers excluded from data eviction quotas | Subtracted from used_memory when computing effective eviction utilization |
ENGULA INFO memory → engula_arena_block_bytes |
Total byte footprint currently held by compact blocks (including uncompacted deletion holes) | Tracks compact block-pool footprint; pair with engula_recyclable_bytes to gauge reclaimable holes |
ENGULA INFO memory → engula_arena_record_bytes |
Net compressed byte sum of all live records packed inside compact blocks | Net record bytes divided by block bytes gives live block utilization (typically 85%–99% at steady state) |
ENGULA INFO memory → engula_arena_records |
Total live compact records (each field in a large Hash and each member in a large Set counts as a record) | Expected to exceed top-level DBSIZE on collection-heavy workloads |
Inspect physical RSS alongside compact block utilization on any running node:
Before pointing existing Prometheus or Grafana alert rules at Engula nodes, update these two stock heuristics (full alert thresholds in ENGULA INFO & Monitoring):
mem_fragmentation_ratio continues reporting physical RSS divided by allocator-accounted memory. Because Engula manages compressed blocks in a dedicated arena with an independent ~1,000 ms OS page-decay cadence and pre-allocated writable block buffers, healthy steady-state ratios typically sit near 1.55 (and fluctuate between 1.7 and 2.5 under heavy variable-length overwrites)—even while total used_memory_rss remains 40%–75% lower than stock Redis or Valkey.engula_mem_defrag_pressure_ratio (0–1 pressure gauge) and engula_recyclable_bytes under ENGULA INFO evict, and ignore per-object heap warnings from MEMORY DOCTOR.MEMORY USAGE <key> estimates the uncompressed logical object size of a key (for example, a 1 KB string compressed down to 300 bytes inside a block still reports ~1,304 bytes). Always size and audit shards using used_memory_rss.Whenever a non-zero maxmemory ceiling and eviction policy (such as allkeys-lru or volatile-lfu) are configured, the kernel evaluates eviction thresholds against effective logical memory:
To prevent burst writes from slamming into the hard ceiling and causing synchronous foreground stalls, Engula 2.3.0 coordinates two mechanisms:
engula_mem_usage_pressure_ratio): Remains 0 below 80% of the ceiling and ramps linearly toward 1.0 between 80% and 100%, accelerating background sparse-block compaction so deleted space is reclaimed before live keys are evicted.engula-evict-forecast-lead-ms): Defaults to 10,000 ms, projecting net memory growth rate via exponentially weighted moving averages and initiating smooth incremental eviction whenever the ceiling is projected to be reached within 10 seconds. Keep enable-debug-command no in production (enabling debug commands automatically disables predictive eviction).Whereas stock Redis and Valkey deployments often reserve 70%–100% extra RAM above steady-state RSS to survive background snapshot Copy-on-Write (CoW) spikes, Engula's progressive per-block page release bounds peak BGSAVE CoW growth under heavy random writes to approximately +14%.
dump.rdb backup, or attach a read-only shadow replica behind a live primary for one business cycle to measure steady-state used_memory_rss.maxmemory: Set the ceiling above observed allocator memory with 15%–25% headroom for organic dataset growth (during live Cluster slot consolidation, reserve 25%–30% transient headroom on destination shards so incoming RESTORE-ASKING bursts never outpace initial background compression).repl-backlog-size (for example 512 MB), replica/client output buffers, and OS page headroom using:For a production Kubernetes StatefulSet shard configured with maxmemory 32gb and repl-backlog-size 512mb:
disable-thp yes in engula.conf with disabling OS Transparent Huge Pages on the host (see Configuration Guide and Go-Live Checklist) so 2 MB huge pages never amplify Copy-on-Write page faults.