Skip to content

VPS sizing: what actually eats the RAM

Measured on a €6/month box — 2 vCPU, 4 GB RAM, 40 GB NVMe — running one assistant for a single owner, continuously, for six months.

The number people get wrong first

Inference does not happen on your VPS. Unless you are running weights locally, the model call goes to a provider and your machine's job is orchestration: assembling context, running tools, writing to a database, talking to Telegram. That work is memory-light and CPU-spiky, not the other way round.

Steady state on my install:

Component Resident memory
Node process (bot + agent runtime) 240–320 MB
SQLite page cache 30–60 MB
Local embedding model (768-dim, loaded) 400–600 MB
OS + sshd + journald ~200 MB

Idle total lands near 1.1 GB with the embedding model resident, or around 500 MB without it. The remaining headroom is not decoration — it absorbs the spikes below.

Where the spikes come from

Media work. Transcribing a voice note, rendering audio, resizing an image: each of these is a short-lived subprocess that can double your resident memory for thirty seconds. This is the single largest allocation event on the box and it is entirely under your control — serialise it. Two concurrent ffmpeg jobs on a 4 GB machine is how the OOM killer learns your process name.

Embedding backfill. Re-embedding a few thousand chunks after a model change is a batch job that will happily eat everything you give it. Batch it in chunks of 32 and it fits in the headroom; run it unbounded and it does not.

A long conversation with big tool outputs. Context assembly holds several copies of the same strings in memory. Rare, but it is the reason I would not go below 4 GB.

Disk is what actually grows

Six-month totals:

What Size
Conversation archive (chunks + embeddings) ~120 MB
Facts, lessons, journal ~15 MB
Backups (7 daily + 4 weekly, compressed) 1–2 GB
Logs, unrotated the first real outage

The first genuine incident on this install was a full disk caused by an unrotated log file, not by anything interesting. Rotation is not optional, and neither is a retention policy on backups — "keep everything" is a decision to run out of disk at an unpredictable date.

Swap: yes, and it is not cheating

2 GB of swap on a 4 GB box turns an OOM kill into a slow thirty seconds. For an assistant that reacts to a human typing, a slow thirty seconds is annoying; a killed process during a database write is a corrupted afternoon. Set vm.swappiness=10 so it stays a safety net rather than a performance strategy.

What I would change on a rebuild

  • Separate the media work. Media processing is the only genuinely heavy thing here. On a second box, or as a queued job with a hard concurrency limit of one.
  • Keep the embedding model resident. Loading it per request wastes more wall-clock than the RAM is worth.
  • Alert on disk before 80%, and treat "backups grew" as a first-class metric rather than something you notice during an outage.

Two vCPU and 4 GB is genuinely enough for one owner. The failure modes are unbounded growth and unserialised subprocesses — both of which are policy problems, not capacity problems.

The rest of the build is written up at avelina.ai, with longer pieces on the blog.