RAM is the most common source of confusion when choosing a VPS plan. Providers list RAM prominently, but specifications like “2 GB RAM” mean nothing without context — it depends entirely on what you are running. This guide breaks down RAM requirements by application type, explains what actually consumes RAM on a Linux VPS, and helps you choose the right plan without overpaying or under-provisioning.
What Uses RAM on a Linux VPS?
RAM on a running Linux server is consumed by several layers:
- Operating system baseline — Ubuntu 22.04 LTS at idle uses approximately 200–400 MB RAM for the kernel, system services, and essential daemons
- Your application — web server, application runtime, background workers
- Database — MySQL, PostgreSQL, or MongoDB buffer pools cache frequently-accessed data in RAM for fast reads
- Cache layer — Redis or Memcached object caches consume RAM proportional to their configured
maxmemory - Linux page cache — the kernel uses free RAM as a disk cache, speeding up repeated file reads. This is the “used” memory you see in
free -hthat isn’t actually consumed by applications
The key insight: Linux’s memory reporting can be misleading. free -h shows “used” memory that includes the page cache — memory that the kernel will release immediately when an application needs it. What matters is the difference between your applications’ actual allocations and total RAM, not the raw “used” figure.
RAM Requirements by Application Type
Static Website (Nginx, no PHP)
| Traffic | Minimum RAM | Recommended |
|---|---|---|
| Under 10,000 visitors/day | 512 MB | 1 GB |
| 10,000–100,000 visitors/day | 1 GB | 2 GB |
Nginx serving static HTML, CSS, and JS is extremely memory-efficient. Nginx itself uses only 10–50 MB. The limiting factor for static sites is network bandwidth and CPU for TLS, not RAM.
WordPress (Single Site)
| Configuration | Minimum RAM | Recommended |
|---|---|---|
| Basic WordPress, low traffic | 1 GB | 2 GB |
| WordPress with Redis cache | 1 GB | 2 GB |
| WooCommerce store | 2 GB | 4 GB |
| WooCommerce + high traffic | 4 GB | 8 GB |
WordPress memory consumption: PHP-FPM workers (50–80 MB each × number of workers) + MySQL InnoDB buffer pool (256 MB minimum) + Redis (128–512 MB configured). A 2 GB VPS comfortably runs WordPress with 3–5 PHP-FPM workers, MySQL, and Redis. WooCommerce needs more MySQL buffer pool for product catalogue queries — 4 GB is the practical floor.
Node.js Application
| Configuration | Minimum RAM | Recommended |
|---|---|---|
| Single Node.js process | 512 MB | 1 GB |
| Node.js + database | 1 GB | 2 GB |
| Multiple Node.js processes (PM2 cluster) | 2 GB | 4 GB |
| Next.js SSR application | 1 GB | 2–4 GB |
Node.js is memory-efficient at the runtime level — a basic Express app uses 50–150 MB. Next.js SSR applications use significantly more due to React rendering overhead: expect 200–500 MB per process. PM2 cluster mode spawns one process per CPU core; multiply per-process RAM by core count.
Python Application (Django / FastAPI / Flask)
| Configuration | Minimum RAM | Recommended |
|---|---|---|
| Django / Flask (Gunicorn, 2 workers) | 512 MB | 1–2 GB |
| Django + PostgreSQL | 1 GB | 2 GB |
| FastAPI with heavy ML dependencies | 2 GB | 4 GB |
| Celery worker processes | +512 MB per worker | — |
Python applications using data science libraries (numpy, pandas, scikit-learn) can be memory-intensive — these libraries load large compiled extensions. A FastAPI application that imports pandas and scikit-learn uses 500 MB–1 GB just for the import, before processing any requests.
MySQL Database (Self-Managed)
| Database Size | Minimum RAM | Recommended |
|---|---|---|
| Under 1 GB database | 1 GB | 2 GB |
| 1–10 GB database | 2 GB | 4 GB |
| 10–50 GB database | 4 GB | 8–16 GB |
| 50+ GB database | 16 GB | 32 GB+ or dedicated server |
MySQL’s InnoDB buffer pool is the single most important memory allocation for database performance. The rule of thumb: set innodb_buffer_pool_size to 70% of available RAM on a dedicated database server, or 40–50% on a shared application+database server. A buffer pool that fits your active dataset in RAM eliminates disk I/O for cached queries.
Docker / Docker Compose Stack
| Configuration | Minimum RAM | Recommended |
|---|---|---|
| 1–2 small containers | 1 GB | 2 GB |
| Full app stack (app + db + Redis) | 2 GB | 4 GB |
| 5–10 containers (Coolify / multi-service) | 4 GB | 8 GB |
| Docker + CI/CD builds | 4 GB | 8 GB |
Docker itself uses approximately 100–200 MB for the daemon. Container RAM usage depends on the workload inside the container — same as running the application natively, plus a small overhead per container for the container runtime. Docker Compose stacks running a database container require the same MySQL/PostgreSQL buffer pool sizing as native installations.
Self-Hosted Tools
| Application | Idle RAM | Under Load |
|---|---|---|
| GitLab CE | 2.5–3.5 GB | 3–5 GB |
| Nextcloud | 300–600 MB | 500 MB–1.5 GB |
| n8n (with PostgreSQL) | 400–800 MB | 600 MB–1.5 GB |
| Grafana + Prometheus | 400–800 MB | 1–3 GB (depends on metrics volume) |
| Vaultwarden | 15–50 MB | 50–100 MB |
| Uptime Kuma | 80–150 MB | 150–300 MB |
| Typesense | Depends on index size | Index size × 2 |
| Ollama (7B model, CPU) | 8–10 GB | 10–14 GB |
VPN Server (WireGuard)
WireGuard is remarkably lightweight: the daemon uses 5–20 MB regardless of peer count. For a team VPN serving 10–50 users, a 1 GB VPS handles WireGuard comfortably. The bottleneck for VPN servers is network throughput (CPU for encryption), not RAM.
Game Servers
| Game | Players | Recommended RAM |
|---|---|---|
| Minecraft (vanilla) | 10–20 | 4 GB |
| Minecraft (modded) | 10–20 | 8–12 GB |
| Palworld | 1–32 | 16 GB |
| CS2 (10v10) | 20 | 8 GB |
| Valheim | 1–10 | 4 GB |
How to Calculate Your RAM Requirement
Add up the components:
OS baseline: 300 MB
+ Web server (Nginx): 50 MB
+ App runtime (4 PHP-FPM):300 MB (75 MB × 4 workers)
+ MySQL (buffer pool): 512 MB
+ Redis: 256 MB
+ Safety headroom (20%): 283 MB
= Total recommended: ~1.7 GB → choose 2 GB plan
The 20% safety headroom prevents OOM (Out of Memory) kills when traffic spikes temporarily increase worker count or buffer usage.
Signs Your VPS Is RAM-Constrained
- OOM kills in system logs:
dmesg | grep -i "out of memory"— the kernel killed a process because RAM was exhausted - High swap usage:
free -hshows significant swap used — your applications are spilling to disk, severely degrading performance - MySQL query slowdowns under load — buffer pool thrashing as the database evicts cached pages to make room for new ones
- PHP-FPM worker kills — if PHP-FPM workers are killed by OOM, requests queue and eventually return 502 errors
# Check OOM events
dmesg | grep -i "killed process"
# Check current RAM usage by process
ps aux --sort=-%mem | head -20
# Check swap usage
free -h
swapon --show
Adding SWAP as a Safety Net
SWAP (disk-based virtual memory) is not a substitute for RAM — it is 100–1,000× slower. But a small swap partition prevents catastrophic OOM kills during unexpected traffic spikes, giving you time to resize your VPS rather than suffering a crash.
# Create 2 GB swap file
fallocate -l 2G /swapfile
chmod 600 /swapfile
mkswap /swapfile
swapon /swapfile
# Make permanent
echo "/swapfile none swap sw 0 0" >> /etc/fstab
# Reduce swappiness (use RAM first, swap as last resort)
echo "vm.swappiness=10" >> /etc/sysctl.conf
sysctl -p
vm.swappiness=10 tells the kernel to use swap only when RAM is 90% full — maintaining RAM as the primary working memory while having swap as an emergency buffer.
RAM Planning: The Simple Decision Table
| What you’re running | Choose this RAM |
|---|---|
| VPN server / WireGuard only | 1 GB |
| Small WordPress blog | 1–2 GB |
| WordPress + WooCommerce | 4 GB |
| Node.js / Django app + database | 2–4 GB |
| Docker Compose full stack | 4 GB |
| GitLab CE | 8 GB |
| Coolify + 5–10 apps | 4–8 GB |
| LLM inference (7B model) | 16 GB |
| Large PostgreSQL database (>10 GB) | 8–16 GB |
| Game server (Minecraft/Palworld) | 8–16 GB |
Conclusion
The right amount of RAM for your VPS depends entirely on your workload. The most common mistake is under-provisioning — choosing 1 GB for a WooCommerce store, or 2 GB for GitLab — and discovering through OOM kills and swap thrashing that the application needs more. The second most common mistake is over-provisioning: a WireGuard VPN server running on a 16 GB plan is paying for 15.8 GB of RAM it will never use.
Use the tables in this guide to estimate your requirement, add 20% headroom, and size up — RAM upgrades on a VPS are straightforward, but the performance penalty while RAM-constrained is immediate and user-visible.
Choose the right plan: Browse Server.HK Hong Kong VPS plans — available from 1 GB to 32 GB RAM, all with NVMe SSD and CN2 GIA routing as standard.