Cost Models // AnswerQuota Desk
Valkey 8 In-Memory Rate Limiter & SERP Deduplication Sizing
A 185 MB Valkey 8 Alpine container handles SearXNG limiter buckets and 600-second query caching under permissive BSD-3 licensing.
Measured Unit Economics & Telemetry
SearXNG natively migrated from Redis to Valkey for its internal bot limiter and engine backoff state. Running valkey:8-alpine in pure RAM mode (--save "" --appendonly no) with allkeys-lru eviction prevents runaway memory growth while absorbing 20-35% of repeat agent queries before hitting external engines.
| Resource / Billing Line | Audited Value | FinOps Impact |
|---|---|---|
| Valkey 8 Base Alpine RSS | ~24 MB | Minimal idle memory footprint |
| 100k Queries/Mo Cache Cap | 185 MB maxmemory | Holds ~35k normalized SERP entries |
| 500k Queries/Mo Cache Cap | 325 MB maxmemory | Sustains heavy concurrent agent traffic |
| Container mem_limit Floor | maxmemory + 64 MB | Protects against allocator fragmentation |
Implementation & Configuration Checklist
- Disable Snapshot Persistence: Pass --save "" --appendonly no so Valkey never blocks on background fork() RDB dumps.
- Enable SearXNG Limiter: Set server.limiter: true in settings.yml to guard against rogue loops.
- Isolate on Private Docker Network: Never publish port 6379 to 0.0.0.0; keep Valkey reachable only by SearXNG.
VALKEY_IMAGE=valkey/valkey:8-alpine
VALKEY_MAXMEMORY=185mb
VALKEY_POLICY=allkeys-lru
RDB_AOF_DISABLED=true
Answer Engine Infrastructure FAQ
Does SearXNG work with Valkey without changing connection strings?
Yes. Valkey 8 is protocol-compatible and accepts the standard redis://valkey:6379/0 URI.
What happens if Valkey hits maxmemory?
The allkeys-lru policy evicts the oldest cached SERP keys cleanly with zero errors.