LiteLLM + MCP Gateway VPS: 4GB vs 8GB RAM
An isolated LiteLLM Proxy + PostgreSQL 16 + Redis 7 + Caddy 2.8 + Progressive MCP Gateway idles near ~687 MB RSS, yet concurrent multi-agent JSON bursts spike memory to ~2.8–3.1 GB. A 2 GB VPS OOM-kills LiteLLM with Exit Code 137; 4 GB RAM + 2 GB swap is the strict solo floor, while 8 GB NVMe RAM is mandatory if you co-host OpenClaw/Hermes, n8n, or Playwright tools on the same box.
| Container Service | Idle RSS | Burst Peak | Recommended mem_limit |
|---|---|---|---|
| Caddy 2.8 (Auto TLS Reverse Proxy) | 28 MB | 65 MB | 128m |
| Redis 7 (--maxmemory 192mb LRU) | 35 MB | 210 MB | 256m |
| PostgreSQL 16 (Spend Ledger) | 64 MB | 380 MB | 512m |
| LiteLLM Proxy (--num_workers 2) | 420 MB | 1,350 MB | 1536m |
| Progressive MCP Gateway (No Browser) | 140 MB | 820 MB | 1024m |
| Optional: OpenClaw/n8n + Playwright | +750 MB | +2,600 MB | Upgrade to 8 GB VPS |
Real-World Constraints, Drivers, Acoustics & Power Limits
- Worker count trap: Setting
--num_workers 4or8on a 4 GB VPS consumes ~1.6 GB at idle before traffic arrives—keep--num_workers 2on 4 GB nodes. - Docker UFW bypass: Always bind port 4000 internally on a Docker bridge behind Caddy TLS (
443), never publish4000:4000on0.0.0.0. - 4K fsync disk requirement: PostgreSQL spend logging stalls on oversold spinning/slow disks—verify >1,500 4K fsync IOPS with
nodebudget-vps-benchbefore production rollout.
Do NOT pay for an 8 GB or 16 GB VPS if you only run LiteLLM + Progressive MCP for 1–2 developers without headless Chromium—a $4–$6/mo 4 GB KVM node with 2 GB swap handles it effortlessly.
Track Street-Price Drops & New Lab Benchmarks
Comparing $200–$2,200 hardware usually takes a few weeks. Leave your email to get a single plain-text note when Strix Halo 128 GB, Mac mini M4 Pro, or Beelink EQ14 street prices drop or new benchmarks publish. No spam, unsubscribe anytime.
Technical FAQ
Why does LiteLLM crash with Exit Code 137 on a 2 GB VPS?
Two Python workers plus PostgreSQL checkpoints and concurrent large JSON tool payloads exceed 2 GB quickly. Without swap and explicit mem_limit caps, Linux OOM-kills the largest process (LiteLLM).
Can I share one PostgreSQL 16 container between n8n and LiteLLM?
Yes, using separate databases and users inside one tuned Postgres 16 container saves ~200 MB RAM—just schedule nightly pg_dump backups to Cloudflare R2.