Skip to content
HOSTIGAN
VPS

What is the difference between RAM and vCPU?

vCPUs do the work, RAM holds it. Learn what each one does on a VPS, what happens when either runs out, and how to find out which one is really slowing you down.

Beginner 5 min read Updated November 24, 2026

When a server feels slow, the instinct is to buy "a bigger one". But a VPS has two quite different engines — vCPUs and RAM — and adding the wrong one is money spent for nothing. The simplest way to remember the difference: vCPUs determine how much work can be done at once; RAM determines how much can be kept ready at once. This guide explains both, shows what happens when each runs out, and gives you the commands to find your real bottleneck.

What a vCPU is

On a KVM-based VPS, each vCPU is a virtual processor that the host's scheduler runs on its physical cores. To your operating system it looks like an ordinary CPU core.

Two details are worth knowing:

  • Hardware threads are not full cores. Modern processors run two threads per core (SMT or Hyper-Threading). A vCPU may map to one of those threads, which is plenty for most work but not the same as a whole core to yourself.
  • Parallel vs. single-threaded work. A web server answering 50 requests can spread them over many vCPUs. A program that does its work on one thread can only ever use one vCPU, no matter how many you have.

That second point explains a classic misunderstanding: if one vCPU is pinned at 100% while the others idle, you do not have a CPU shortage — you have a single-thread bottleneck. More vCPUs will not fix it; a faster core or a change in the software will.

What RAM is used for

Memory on a server does three jobs at the same time:

  1. Running programs. Every process needs memory for its code and data — PHP-FPM workers, Node.js processes, a Java application with its configured heap.
  2. Database buffers. MySQL and MariaDB keep hot data in the InnoDB buffer pool; PostgreSQL uses shared_buffers plus the operating system's cache. When the working set fits in memory, queries are fast.
  3. File cache. Linux uses otherwise idle memory to cache files from disk, and hands it back instantly when a program needs it.

Because of that third point, a Linux server almost always looks "full". That is normal. Look at the available column, not free:

free -h
               total        used        free      shared  buff/cache   available
Mem:           3.8Gi       1.6Gi       210Mi        48Mi       2.3Gi       2.2Gi
Swap:          2.0Gi          0B       2.0Gi

Here only 210 MB is "free", but 2.2 GB is available — the server is fine.

What happens when RAM runs out

Running out of memory is not gradual. On Linux it goes roughly like this:

  1. The file cache shrinks. Disk reads get slower, but nothing breaks yet.
  2. Swap is used. Rarely used memory is moved to disk.
  3. Constant swapping. Active memory is shuffled to and from disk; everything becomes painfully slow.
  4. The OOM killer steps in. The kernel kills a process to free memory — very often the largest one, which on a web server is usually the database.

The symptom users see is typically "Error establishing a database connection" or a 502 error, not a clear "out of memory" message. Check the kernel log to confirm:

sudo journalctl -k | grep -iE "out of memory|oom-kill"

On Windows the equivalent is the page file filling up; once committed memory reaches the commit limit, applications fail to allocate memory and may crash.

What happens when the CPU runs out

CPU shortage is gentler. Work simply queues up: pages take longer, jobs finish later, but things rarely crash. Two numbers tell you what is going on:

  • Load average — shown by uptime and top. Compare it with the number of vCPUs (nproc). A load of 4 on a 4-vCPU server means it is fully busy; a load of 8 means work is waiting.
  • Steal time (st in top) — time your VPS wanted CPU but the hypervisor gave it to someone else. A consistently high value points to a busy host rather than your own workload.

How to find your bottleneck

Run these during a busy period, not at 3 a.m.:

nproc                 # how many vCPUs you have
lscpu                 # CPU model and threads per core
uptime                # load average
top                   # press 1 for per-vCPU usage, M to sort by memory
vmstat 1 10           # r = run queue, si/so = swap in/out, wa = I/O wait, st = steal

On Windows Server, open Task Manager → Performance, right-click the CPU graph to show logical processors, and watch Committed under Memory. Resource Monitor shows hard faults per second, which climb when Windows is paging heavily.

SymptomLikely cause
si/so regularly above 0, available close to 0Too little RAM
OOM-kill entries in the kernel logToo little RAM, or a memory leak
Load average well above nproc, all vCPUs busyToo few vCPUs
One vCPU at 100%, others idleSingle-thread bottleneck
High wa with little swappingDisk-heavy workload, often a database short on cache
High stBusy host — contact your provider

For long-term graphs and alerts, see How to monitor CPU, RAM, disk and network on your VPS.

Which resource matters for which workload

  • WordPress and PHP sites — mostly RAM (PHP workers and database), with CPU during traffic spikes.
  • Databases — RAM first, so the working set stays in memory.
  • Game servers such as Minecraft — fast single-thread performance and plenty of RAM.
  • Docker hosts — RAM, as every container adds its own processes.
  • Video encoding, compiling, CI builds — vCPU count; these jobs parallelise well.
  • Windows Server with Remote Desktop users — RAM, since every session runs its own desktop and programs.
  • Light services (VPN, bots, DNS) — neither is likely to be a problem.

Common mistakes

  • Buying vCPUs to fix a RAM problem. If the server swaps or the OOM killer fires, more cores change nothing.
  • Treating a crashed database as a database bug. Check the kernel log for OOM kills first.
  • Reading a low CPU graph as "no load". An average of 25% on four vCPUs can mean one core is maxed out.
  • Panicking about "used" memory. Linux file cache is supposed to fill RAM; watch available.
  • Disabling swap or dropping caches by hand. Both make things worse in normal operation.

Tip: Before upgrading, change one thing at a time and measure again. Sometimes a smaller PHP worker count or a correctly sized database buffer is all it takes.

In short

vCPUs do the work; RAM holds the work and the data it needs. CPU shortage makes things slow, while RAM shortage makes things slow and then makes them crash. Measure under real load with free, top and vmstat, check the kernel log for OOM kills, and upgrade the resource that is actually short. If you are choosing a new plan, How to choose the right VPS puts these numbers into practice, and What is a VPS? covers the basics.

RAM and vCPU on a Hostigan VPS

Hostigan's VPS plans run on KVM, so the vCPUs and RAM in your plan behave like a normal machine to your operating system. The hosts use AMD EPYC and Intel Xeon processors with ECC memory, which detects and corrects memory errors before they reach your applications, and storage is NVMe on a Ceph cluster.

Frequently asked questions

Usually not. A small swap file gives Linux somewhere to put rarely used memory and buys time before the OOM killer steps in. Constant heavy swapping is a sign you need more RAM, not a reason to remove swap.

Next in “Get started with a VPS” · 5 of 11How to restart, shut down and manage your VPS