Production Manual

VergeKV Distributed Cache & Telemetry Engine

VergeKV is a lightweight, single-binary in-memory key-value store and time-series metrics aggregator engineered for low-latency regional edge clusters. It provides lock-free shard partitioning, deterministic WAL snapshots, and Prometheus-compatible HTTP/2 telemetry endpoints.

  • Sub-millisecond reads: Lock-free slab allocator pinned per CPU core.
  • Bounded memory: Configurable LFU/TinyLFU eviction policies with strict RSS caps.
  • Zero-downtime reloads: Atomic SIGHUP config validation without dropping active pools.

2. Storage & Replication Architecture

Each VergeKV node partitions the 64-bit Murmur3 keyspace into 64 virtual shards. Write operations append synchronously to a CRC32C-framed write-ahead log (WAL) before updating the in-memory index, while asynchronous replication streams delta frames over persistent HTTP/2 connections.

ComponentDefault MechanismFailure Behavior
Slab Allocator2 MiB arena chunks, 8-byte alignedTriggers TinyLFU eviction at 90% watermark
WAL CompactionBackground merge every 60s or 64 MiBReplays last clean checkpoint on startup
Health ProbesRaft-lite lease heartbeat (500 ms)Marks peer degraded after 3 missed intervals

3. Quickstart

Install via APT (Debian 12+ / Ubuntu 22.04+)

curl -fsSL https://packages.vergekv.example/apt/gpg | sudo gpg --dearmor -o /usr/share/keyrings/vergekv.gpg
sudo apt-get update && sudo apt-get install -y vergekv
sudo systemctl enable --now vergekv

Verify Node Health

vergekv-ctl status --addr 127.0.0.1:9102
# Expected: cluster_state=ready shards=64 rss_mb=42.8

4. Configuration Reference

Configuration lives in /etc/vergekv/server.toml and supports live reload.

[node]
id = "us-west-edge-01"
listen_addr = "127.0.0.1:9102"
shards = 64

[memory]
max_rss_mb = 512
eviction_policy = "tinylfu"
ttl_sweep_interval_ms = 250

[wal]
dir = "/var/lib/vergekv/wal"
fsync = "everysec"

5. Telemetry & Metrics API

VergeKV exposes read-only operational histograms over HTTP/2 JSON and OpenMetrics text format. Production deployments typically place an edge TLS terminator in front of the local metrics listener.

EndpointMethodDescription
/healthzGETReturns 200 OK when WAL and shard workers are healthy.
/v2/shards/summaryGETPer-shard key count, hit ratio, and tail p99 read latency.
/v2/compaction/statsGETLast WAL compaction timestamp, reclaimed bytes, and queue depth.

6. Troubleshooting

High Eviction Rate

Inspect vergekv_evictions_total and confirm max_rss_mb leaves at least 25% headroom for OS page cache. Large value payloads (> 256 KiB) should enable LZ4 frame compression.

Slow WAL Replay on Restart

Reduce wal.compact_threshold_mb from 64 to 32 so dirty segments stay small on NVMe or virtualized block storage.