ENGINEERING REFERENCE / RAM / 011

VPS RAM Calculator

Budget server memory for your workload, working set, cache and safety margin.

Reference specifications

STATIC / DEFAULTS

Default: 10 active connections, 2 GB dataset, no cache and 25% headroom. OOM risk is modeled at the minimum.

WorkloadMinimum RAMRecommended RAMOOM risk / memory driver
WordPress4 GB4 GBLOW OOM risk · PHP workers and database cache
Docker & Compose4 GB4 GBLOW OOM risk · Containers and sidecars
Node.js & Web API4 GB4 GBLOW OOM risk · Node processes and heap
PostgreSQL4 GB4 GBLOW OOM risk · Buffers and active connections
Redis4 GB8 GBMEDIUM OOM risk · Resident dataset and metadata
Game Server4 GB8 GBHIGH OOM risk · World data and active players
01 / MEMORY BUDGET

Build the RAM budget from live work

A VPS RAM budget showing operating system, application workers, active working set and OOM safety headroom.
Default WordPress example, calculated from the same memory model as the interactive tool.

A VPS RAM calculator is a starting budget, not a substitute for observing your own processes. Choose the workload closest to your server, then enter active connections rather than total registered users. A connection that is waiting can consume less memory than a worker executing a large query, so measure a representative busy interval and adjust the result when you know the real worker footprint.

What each part includes

The operating system and daemons reserve 0.75 GB as an initial allowance. A monitoring agent, security scanner, logging service or large filesystem cache may require more. Application memory combines a preset base with a per-active-connection estimate. The working-set line covers an assumed portion of the entered dataset plus a cache allowance. The model does not claim that every application has the same process size or access pattern.

The recommended size adds your chosen 10–50% OOM safety headroom to the modeled base and rounds upward to a common VPS memory step. The minimum rounds the base alone. The indicator describes spare room at that minimum: under 10% is high risk, under 25% is medium and more is low in this model. It is not a prediction of the probability of an OOM event. Deployment overlap, migrations and a sudden surge can exceed any estimate.

Choose a realistic caching layer

No cache assumes all modeled activity reaches the application. A page or reverse proxy cache reduces modeled worker pressure and reserves 0.15 GB for the cache service. The object plus Redis setting reduces modeled worker pressure further and adds 0.4 GB for cache services. These are illustrative multipliers, not measured hit rates. Logged-in requests, writes and cache misses still reach the application, and a large Redis dataset can exceed the allowance.

The dataset input represents active data relevant to the host. Presets use different resident fractions: Redis starts at the full entered dataset, PostgreSQL at 55%, game servers at 50%, Docker at 35%, Node at 30% and WordPress at 25%. Those fractions are assumptions, not guarantees. For a cache with persistence, budget extra memory for metadata and possible copy-on-write during snapshots. If your actual measured working set differs, use it to revise the estimate.

Count workers before buying memory

For WordPress, multiply the number of simultaneously busy PHP-FPM workers by their observed private memory. Add the database, web server, scheduled jobs and any Redis process. Shared libraries make summing RSS an imperfect measurement; proportional or private memory and the host's available-memory metric can give better context. A small pool limit can prevent exhaustion but may increase request queue time.

Node.js services need room for the runtime heap, native buffers and every process or container, not only the configured JavaScript heap. A PostgreSQL server uses shared buffers and per-operation memory as well as connection overhead; multiple simultaneous operations can multiply the latter. For a game server, measure the actual map, plugins and peak player count rather than assuming a standard RAM cost per player.

02 / VALIDATE

Test the result under peak load

Run representative requests, background jobs and a deployment at the same time in a safe test environment. Record peak memory available, application resident and private memory, swap activity, queue length and latency. Inspect the kernel log for killed processes and check container limits as well as host totals. A process can be OOM-killed by its container limit even when the VPS still has free memory.

Linux can use otherwise idle memory for page cache, which is often reclaimable. That is useful capacity, not necessarily a leak. In contrast, persistent swap activity and falling available memory during peak work are signs to investigate. Swap on NVMe can soften a brief spike but is much slower than RAM and cannot guarantee that a large burst survives. Set alerts and test recovery before treating swap as a safety plan.

Set limits and alerts before the first incident

Record a baseline after a clean restart, then repeat during normal traffic, a deployment and a backup. An alert on available memory is more useful when it includes duration and the workload's usual range; a momentary dip alone may be harmless. Alert separately on repeated OOM kills, swap growth and a steadily expanding application heap. Store enough history to distinguish a daily traffic peak from an actual leak.

For container workloads, compare the sum of memory limits with the host's available budget. A container without a limit can compete with its neighbors, while an excessively tight limit may kill an otherwise healthy process. Leave space for the kernel and monitoring agents outside the containers. A rolling restart can temporarily double the number of workers, so check deployment settings as well as steady-state counts.

Read the matched plans carefully

The three tiers compare modeled CPU, RAM and storage with the reference catalog. Value meets the modeled minimum; Balanced meets the recommendation; Headroom adds memory where the catalog permits. A recommendation may be unavailable when no listed plan fits. Storage in a matching plan may be SSD rather than NVMe, and dedicated CPU can be preferable for sustained work. Confirm the disk type, location, current offer and billing directly.

Use the main VPS calculator for a broader resource estimate, the Docker VPS sizer for multiple services, and the AI agent sizer for browsers and queues. Estimate network traffic with the bandwidth calculator and compare processor options with the VPS CPU benchmark. The methodology explains why the figures are planning assumptions.

FIELD NOTES / FAQ

Frequently asked questions

Does Linux page cache count as application RSS?

No. Page cache is filesystem data held by the kernel and is often reclaimable; RSS describes resident process pages. Inspect available memory and private or proportional process memory together.

What does the Linux OOM killer do?

When memory cannot be reclaimed, the kernel or a container memory controller can terminate a process. Check kernel and container logs, limits and peak memory to identify the cause.

Can NVMe swap replace RAM?

No. Swap can absorb some short spikes but is slower than RAM, may exhaust disk or hurt latency, and cannot guarantee survival during a large burst.

How much memory should PHP-FPM or Node workers use?

Measure representative workers under load, including native allocations, then multiply by actual simultaneous processes. Include the database, operating system and deploy overlap.

How should I size PostgreSQL shared_buffers?

Treat shared_buffers as one part of the memory budget. Connections, concurrent work_mem operations, maintenance and OS cache also need space; benchmark your configuration.

Does Redis need the entire dataset in RAM?

Redis primarily keeps data in memory. Include object overhead, allocator fragmentation and extra memory for persistence or replication, not only raw payload size.

What does the OOM risk indicator mean?

It describes modeled spare RAM at the rounded minimum size: high below 10%, medium below 25%, otherwise low. It is not an observed probability or a guarantee.