How much CPU, RAM, storage and bandwidth do you need?

A practical way to size a server or hosting plan from how your app actually uses resources, with worked examples and the commands to measure it.

A cream balance scale weighing small cream and terracotta cubes

Choosing a server size often comes down to guesswork: pick something in the middle and hope. Guess too low and your app slows down or crashes under load. Guess too high and you pay every month for capacity you never use.

This guide is for developers and site owners sizing a new server or hosting plan, or wondering whether their current one is right. You will learn what each resource does, what consumes it, how to estimate needs with simple arithmetic, and how to measure real usage so the next decision is based on data.

The examples use round, clearly hypothetical numbers. Your own measurements always beat any estimate.

CPU

The CPU runs your code: handling requests, rendering pages, running queries and compressing responses.

vCPUs vs dedicated cores

Cloud plans describe CPU in vCPUs (virtual CPUs). A vCPU is usually one hardware thread on a physical processor, scheduled by the hypervisor. On most plans vCPUs are shared: other customers' VMs run on the same physical cores, so the CPU time you get can vary when they are busy. Dedicated vCPU or dedicated-core plans reserve physical capacity for you and give more consistent performance.

Burstable CPUs

Some plans are burstable: you get a modest baseline and can burst above it for short periods, often using a system of credits. These suit sites that are quiet most of the time with occasional spikes. They suit poorly anything that runs hot continuously, such as video encoding or a busy API, because it will be throttled back to the baseline.

What drives CPU use

  • Request volume multiplied by the work each request does.
  • Server-side rendering, image processing and PDF generation.
  • Database queries without good indexes.
  • Compression and TLS, which are usually small compared with your app's own work.

RAM

Memory is the resource most likely to cause a crash rather than slowness. When a Linux server runs out, the kernel's out-of-memory (OOM) killer terminates a process, often your app or database.

What consumes RAM on a typical web server:

  • The operating system and background services.
  • Your app's runtime and workers: each Node process, PHP-FPM worker or Python worker holds its own copy of the code and data it has loaded.
  • The database: buffers and caches, plus memory per connection.
  • Caches such as Redis, which keep their whole dataset in memory.
  • The filesystem cache: Linux uses spare memory to cache disk reads. This is healthy; it is released when applications need it.

Worked example: worker maths

The method is the same for every stack: measure the memory one worker uses, decide how much RAM you can give to workers, then divide.

PHP-FPM. Suppose a 4 GB server runs PHP and MySQL. You reserve 1 GB for the operating system and other services and 1 GB for MySQL, leaving 2 GB for PHP. You measure an average PHP-FPM worker at 80 MB. Then:

Text
Available for PHP:   2,048 MB
Average worker size:    80 MB
max_children:        2,048 / 80 = 25.6  -> round down to 25

You would then set this in the pool configuration:

Config
pm = dynamic
pm.max_children = 25
pm.start_servers = 5
pm.min_spare_servers = 3
pm.max_spare_servers = 8

To measure the average worker size on Debian or Ubuntu (the process name includes the PHP version):

Terminal
ps -C php-fpm8.3 -o rss= | awk '{sum+=$1} END {printf "%.0f MB average over %d processes\n", sum/NR/1024, NR}'

Node.js. A Node process runs your JavaScript on a single main thread, so one process uses roughly one core for its JavaScript work. To use 2 vCPUs you would typically run 2 processes. If each measures 200 MB under load, plan for 400 MB plus headroom.

Python (Gunicorn). Gunicorn's documentation suggests (2 × number of cores) + 1 workers as a starting point. On 2 vCPUs that is 5 workers. If each worker measures 120 MB, that is 600 MB for the app alone.

Storage

SSD, NVMe and IOPS

Almost all hosting now uses solid-state storage. NVMe drives connect over a faster interface than older SATA SSDs and handle many simultaneous operations well. The figure that matters most for databases is IOPS (input/output operations per second) and latency, not just raw capacity. Network-attached block volumes are convenient and can be resized, but are often slower than local NVMe.

What fills a disk

  • The operating system and runtime images, including old container images.
  • Logs, which grow forever unless rotated.
  • User uploads, which only ever grow.
  • The database, including indexes and write-ahead logs.
  • Local backups and dumps, which are easy to forget.

Bandwidth and egress

Bandwidth is the data your server sends to visitors. Providers usually include an allowance or bill outbound traffic (egress) per gigabyte. Estimate it as average page weight multiplied by page views, plus API and bot traffic.

A hypothetical example:

Text
Average page weight:       2 MB
Page views per month:      100,000
Page traffic:              2 MB x 100,000 = 200,000 MB = about 200 GB
Add 25% for bots, APIs:    200 GB x 1.25 = 250 GB per month

If images and scripts are served from a CDN, most of that weight leaves the CDN rather than your server, and your own egress drops accordingly. For CDN set-up, see Cloudflare explained.

Sizing common stacks

These are starting points to test against, not guarantees. Traffic patterns, plugins and query design change everything.

StackWhat dominatesStart by watching
WordPressPHP workers, database, pluginsPHP-FPM memory, slow queries, uploads on disk
Node.js APIProcess count, in-memory data, database poolMemory per process, event loop delay, CPU per request
PostgreSQLMemory for caching data, disk speedCache hit ratio, disk latency, connection count

For PostgreSQL, the official documentation suggests that a reasonable starting value for shared_buffers on a dedicated database server is 25% of system memory. Each connection is a separate process with its own memory, so a high max_connections value has a real cost; a connection pooler helps, as explained in scaling a web application.

On a managed platform the same principles apply, but you choose a plan rather than individual resources. On Launchpad, for example, Starter includes 5 GB of disk and Pro includes 50 GB with more power per app, and for a WordPress site the themes, plugins and uploads in its saved folder count towards that disk.

Step by step: measure real usage

  1. Check CPU and memory live with htop. Sort by memory (M) or CPU (P) to find the biggest consumers.
  2. Check overall memory with free -h. Look at the available column, not free, because Linux uses spare memory for cache.
  3. Check disk space with df -h, and find what is using it with du.
  4. Watch trends over time with vmstat, which shows run queue, swapping and steal time.
  5. Check containers with docker stats if your app runs in Docker.
  6. Repeat at your busiest time of day or week, because averages hide peaks.
Terminal
free -h
df -h
sudo du -sh /var/log/* | sort -h | tail -n 10
vmstat 5 6
docker stats --no-stream

For continuous visibility rather than spot checks, set up monitoring; see monitoring and uptime.

Rules of thumb for headroom

These are rules of thumb, not laws. Adjust them to your own risk tolerance.

  • CPU: if sustained usage at peak is regularly above about 70%, latency usually starts to suffer. Investigate or resize.
  • Memory: keep enough available memory that a traffic spike does not trigger the OOM killer. Any regular swapping is a signal to act.
  • Disk: start cleaning up or resizing at around 80% full. Databases and log rotation need free space to work.
  • Bandwidth: plan for your busiest month, not your average one.

Common mistakes

  • Reading free instead of available memory. Fix: use the available column; cached memory is reclaimable.
  • Setting PHP-FPM or Gunicorn workers by guesswork. Fix: measure worker size and use the division above.
  • Never rotating logs. Fix: configure logrotate, and cap the systemd journal with journalctl --vacuum-size=500M.
  • Keeping old container images. Fix: run docker image prune periodically.
  • Sizing from a quiet afternoon. Fix: measure at peak, or load test before launch.

Security notes

  • Running out of disk or memory can take a site offline as effectively as an attack. Alert on both before they hit their limits.
  • Rate-limit public endpoints so one aggressive client or bot cannot consume all your CPU.
  • Keep backups off the server. A full disk or failed volume should never take your only copy with it.
  • Do not run monitoring dashboards publicly without authentication; they reveal a lot about your system.

Troubleshooting

SymptomLikely causeFix
App killed at random, Out of memory in kernel logsToo many workers or a memory leakReduce worker count, find the leak, or add RAM
High load but low CPU usageProcesses waiting on disk (I/O wait)Check wa in vmstat; optimise queries or use faster storage
Disk full unexpectedlyLogs, uploads or old imagesUse du to find it; rotate logs and prune images
Slow during short spikes onlyBurstable CPU out of creditsMove to a non-burstable or dedicated-vCPU plan

Frequently asked questions

How much RAM does a small website need?

It depends on the stack. A static site needs very little. A dynamic site with a database needs enough for the operating system, the app's workers and the database together. Measure a test deployment and add headroom.

Is more CPU or more RAM usually the answer?

Look at what is running out. If memory is near its limit or the server swaps, add RAM. If CPU is pinned at peak and memory is fine, add CPU. Often the real fix is a slow query.

Does an SSD make a big difference?

For databases and anything that reads and writes many small files, yes. Disk latency directly affects query time.

Should I size for future growth?

Size for what you can measure now plus sensible headroom, and choose a provider or plan that lets you resize easily. Paying for capacity years in advance rarely makes sense.

Next steps

Sizing is a cycle: estimate, deploy, measure at peak, then adjust. Worker maths and simple bandwidth arithmetic get you a sensible starting point; real measurements tell you when to change it.

Share this articleLinkedIn (opens in a new tab)X (opens in a new tab)Facebook (opens in a new tab)
Was this article helpful?

Get new guides in your inbox.

One email a month. Unsubscribe anytime.