Agent Cost Control 4 GB Floor (Solo) · 8 GB Required with OpenClaw/n8n

LiteLLM + MCP Gateway VPS: 4GB vs 8GB RAM

Engineering Verdict (TL;DR)

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.

Idle Combined RSS ~687 MB
Burst Concurrent Peak ~2.8–3.1 GB
Safe VPS Floor 4 GB + 2 GB Swap
Container Memory Allocation & Docker mem_limit Spec (Linux 6.8 KVM)
Container ServiceIdle RSSBurst PeakRecommended mem_limit
Caddy 2.8 (Auto TLS Reverse Proxy)28 MB65 MB128m
Redis 7 (--maxmemory 192mb LRU)35 MB210 MB256m
PostgreSQL 16 (Spend Ledger)64 MB380 MB512m
LiteLLM Proxy (--num_workers 2)420 MB1,350 MB1536m
Progressive MCP Gateway (No Browser)140 MB820 MB1024m
Optional: OpenClaw/n8n + Playwright+750 MB+2,600 MBUpgrade to 8 GB VPS

Real-World Constraints, Drivers, Acoustics & Power Limits

  • Worker count trap: Setting --num_workers 4 or 8 on a 4 GB VPS consumes ~1.6 GB at idle before traffic arrives—keep --num_workers 2 on 4 GB nodes.
  • Docker UFW bypass: Always bind port 4000 internally on a Docker bridge behind Caddy TLS (443), never publish 4000:4000 on 0.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-bench before production rollout.
Who Should NOT Choose This Setup

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.

Format: [email protected] · Plain-text updates only
⚠ Enter an email address in the format [email protected].

Stored on our own server only—never sold or shared with ad networks. Privacy policy.

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.

Related Hardware & Agent Decision Specs

View All 10 Specs →