Cost Models // AnswerQuota Desk
SearXNG uWSGI + Gevent Worker RSS & Concurrency Model
Each SearXNG uWSGI worker uses ~125 MB RSS plus 160 MB shared base, sustaining 60 concurrent outbound engine sockets via gevent greenlets.
Measured Unit Economics & Telemetry
SearXNG uses uWSGI paired with gevent asynchronous greenlets to query 8-12 upstream search engines simultaneously per user request. Under-sizing workers throttles multi-user concurrency, while spawning 16 workers on an 8 GB VPS wastes >2 GB RAM. Matching 2 workers on KVM 2 and 4 workers on KVM 4 balances memory and throughput.
| Resource / Billing Line | Audited Value | FinOps Impact |
|---|---|---|
| 2 uWSGI Workers (KVM 2 / 8 GB) | ~410 MB RSS | 120 outbound sockets (~20 req/s) |
| 4 uWSGI Workers (KVM 4 / 16 GB) | ~660 MB RSS | 240 outbound sockets (~45 req/s) |
| 8 uWSGI Workers (High Concurrency) | ~1,160 MB RSS | 480 outbound sockets (~90 req/s) |
| Recommended Container mem_limit | workers*125 + 416 MB | Leaves headroom for XML/HTML lxml parsing |
Implementation & Configuration Checklist
- Match Workers to 1x-2x vCPU: Set UWSGI_WORKERS=2 on 2 vCPU KVM 2 and UWSGI_WORKERS=4 on 4 vCPU KVM 4.
- Keep Gevent Enabled: Ensure SearXNG runs with gevent worker mode rather than synchronous prefork threads.
- Disable Unused Heavy Engines: Turn off slow or unused media/torrent engines in settings.yml to reduce per-request lxml parsing.
UWSGI_WORKERS=4
UWSGI_THREADS=4
EST_SEARXNG_RSS_MB=660
OUTBOUND_SOCKETS=240
Answer Engine Infrastructure FAQ
Why does SearXNG RAM grow during complex HTML scrapes?
Large SERP pages parsed through lxml create temporary DOM trees; setting mem_limit with 256 MB headroom prevents OOM.
Can 4 uWSGI workers handle 100k queries per month?
Easily. 100k queries/mo averages <0.04 req/s, and 4 workers handle bursts up to 45 req/s.