How much RAM and CPU does a website need?

Rough starting sizes for common sites, why memory runs out before CPU, and how to measure what your own site actually uses.

2–3 minutes
Inside a rack server with expansion cards

There is no single answer, because a static page and a busy online shop are different workloads. But most sites fall into a few patterns, and you can measure your own usage instead of guessing.

A small WordPress or PHP site runs comfortably on 1 to 2 GB of RAM and 1 to 2 vCPUs. A busy site with a shop, many plugins or heavy traffic usually wants 4 GB or more. Memory usually runs out before CPU does.

Starting points

SiteRAMvCPUNotes
Static HTML site512 MB1The web server barely works
Small WordPress or PHP site1 to 2 GB1 to 2Add page caching and it will handle a lot
Several small sites on one server2 to 4 GB2Each PHP pool and database adds overhead
WooCommerce or membership site4 to 8 GB2 to 4Logged-in users bypass page caches
Large application or busy store8 GB and up4 and upConsider separating the database

These assume one server running the web server, PHP and the database together.

Where the memory goes

  • The database. MySQL or MariaDB keeps frequently used data in memory. It is often the largest single user.
  • PHP workers. Each PHP process that handles a request can use 50 to 150 MB with a heavy plugin set. Ten busy workers can easily use a gigabyte.
  • The operating system and file cache. Linux uses spare memory to cache files. That is good, and it is why “used” memory looks high on healthy servers.

When memory runs out, the server starts swapping to disk and slows dramatically, or the kernel stops a process, often the database. Both show up as a slow or broken site.

Why caching changes everything

A cached page is served as a ready-made file without running PHP or touching the database. With page caching, a 2 GB server can serve many thousands of visitors a day. Without it, every visit runs the full application. See what caching is.

Measure your own site

On a Linux server, these show what is actually happening:

free -h
top

In free -h, look at the available column, not “free”. In top, press M to sort by memory and P to sort by CPU. Watch during your busiest hour. If available memory regularly drops below about 10 percent, or swap use keeps climbing, it is time for more RAM or better caching.

Something out of date? Software changes. If a step no longer works, tell us and we will check it and update the page.