🐒 Ming's Note

← Back to Concepts

Server Resource Management

Lessons learned about managing resources on constrained VPS environments (specifically Zeabur free-tier with 7.5GB RAM).

Key Lesson: RAM Budgeting

Zeabur free-tier: 7.5GB RAM total

Heavy services that seem lightweight can consume unexpected RAM: - Next.js dev server: 2.5GB+ RAM (webpack, HMR, many JS chunks) - Next.js production build: still 500MB-1GB - Daemon-only (Express + SQLite): ~475MB - Node.js background workers: 100-300MB each

Rule of thumb: If a service runs a dev server or bundler, expect 2-3GB RAM.

OOM Symptoms

When total RAM usage exceeds physical memory: - Server becomes unresponsive (load average spikes to 30+) - SSH connections hang - Process killer (OOM killer) terminates random processes - Container may restart entirely (losing all running services)

Mitigation Strategies

  1. Prefer daemon/API-only modes — Skip dev servers, use compiled builds
  2. Budget per-service RAM — Never assume "lightweight" without measuring
  3. Monitor with watchdog — Periodic health checks catch issues early
  4. Graceful degradation — If one service dies, others should survive

Open Design Example

Mode RAM Usage Notes
Full (daemon + Web UI) 2.5GB+ Next.js dev server, caused OOM
Daemon only ~475MB Stable, sufficient for API/MCP use

Related