HostingHow Much RAM and CPU Does a VPS Need? WordPress, Node.js and Morehostinq.com

How Much RAM and CPU Does a VPS Need? WordPress, Node.js and More

Choose a VPS that is too small and your site slows down or crashes under load. Choose one that is too large and you pay every month for capacity you never use. There is no single correct size, but there is a sensible way to estimate what you need. This guide explains how CPU and RAM are actually consumed, gives starting points for WordPress, WooCommerce, Node.js and databases, and shows how to tell when it is time to resize.

How a VPS uses its resources

vCPU: work per second

CPU is spent while code runs: PHP building a page, Node.js handling a request, a database sorting rows, compression and TLS handshakes. When nothing is happening, the CPU sits idle. The number of vCPUs decides how many of these jobs can run at the same moment, and the speed of each core decides how quickly a single job finishes.

RAM: what has to stay loaded

RAM is used by everything that is running or cached: the operating system, the web server, each PHP or Node.js process, the database and its buffers, Redis, and the Linux page cache that keeps frequently read files in memory. Unlike CPU, RAM stays allocated even when the server is quiet. Running out of RAM is worse than running out of CPU. The system starts swapping to disk, or the kernel's out-of-memory killer stops processes, often the database first.

Disk and I/O

Disk speed matters most for databases and for anything that writes a lot. NVMe storage handles random reads and writes far better than older disks, so on a modern VPS the disk is less often the bottleneck. Our guide to CPU, RAM and IO in hosting explains these terms in more detail.

A simple way to estimate

Add up the memory of each component you plan to run, then add headroom:

  1. Operating system and basic services: a minimal Ubuntu or Debian server typically uses a few hundred MB.
  2. Web server: Nginx or LiteSpeed usually needs tens of MB. Apache can need more, depending on its modules and mode.
  3. Application processes: the number of workers multiplied by the memory each one uses.
  4. Database: the buffer you assign, plus overhead for connections.
  5. Cache: Redis or Memcached, sized to your data.
  6. Headroom: roughly 20 to 30 percent for spikes, cron jobs, backups and updates.

For CPU, think in terms of uncached work. If an uncached WordPress page takes 100 to 500 ms of CPU time to build, one core can produce roughly 2 to 10 such pages per second, and four cores roughly 8 to 40. Cached pages cost a tiny fraction of that. These are rough planning figures; real numbers depend heavily on your theme, plugins, code and database.

A worked PHP-FPM example

Imagine an 8 GB VPS running WordPress with MariaDB and Redis:

  • Operating system and web server: about 1 GB
  • MariaDB buffer pool: 2 GB
  • Redis: 512 MB
  • Headroom: about 1.5 GB
  • Left for PHP: about 3 GB

If each PHP-FPM worker uses about 80 MB, you can safely run around 35 to 40 workers, which is the pm.max_children setting. Setting it to 100 might look generous, but under load it could exhaust memory and take the database down with it. Measure your real worker size with ps or htop rather than guessing; see Linux process monitoring with top, htop and ps.

Starting points by workload

The table gives reasonable starting sizes for a VPS running one main workload on a well-configured server with caching. Traffic patterns, plugins and code quality can move these numbers a long way in either direction, so treat them as a first estimate to refine with monitoring.

WorkloadvCPURAMNotes
One small WordPress site with page cache1-22 GBMost visitors receive cached pages
Several WordPress sites or a busy blog2-44-8 GBAdd an object cache such as Redis
Small WooCommerce store2-44-8 GBCart, checkout and account pages are not cached
Busy WooCommerce store4-88-16 GBBackground jobs and admin reports add load
Node.js API or app, moderate traffic2-42-8 GBRun one process per core in cluster mode
MySQL or PostgreSQL database server2-88-32 GBRAM should hold the working set
Docker host with several small services4 or more8 GB or moreAdd up the containers, then add headroom

WordPress

A WordPress site with full-page caching is light: most requests are answered from the cache in milliseconds without running PHP at all. What drives resource use is the uncached traffic: logged-in users, the admin area, search, comments, forms and bots that bypass the cache.

  • Set PHP memory_limit to what your plugins need (256 MB is common), but remember that most requests use far less.
  • Use a page cache and an object cache; see Redis and Memcached compared.
  • Replace the default WP-Cron, which runs on page visits, with a real system cron job.
  • Watch the admin area: page builders and heavy dashboards can use more CPU than the public site.

WooCommerce

A store needs more than a blog with the same number of visitors because the pages that matter most are dynamic: cart, checkout, my account and filtered product lists. A checkout can run many database queries, and WooCommerce also runs background jobs through Action Scheduler for emails, webhooks and stock updates.

Plan for peaks, not averages. A sale or a campaign can multiply uncached checkout traffic within minutes. Our guide to hosting requirements for WooCommerce goes into more detail.

Node.js

Node.js runs your JavaScript on a single main thread per process. One Node process therefore uses roughly one core for application code, however many vCPUs the VPS has. To use more cores, run several processes with the built-in cluster module or a process manager such as PM2, typically one per vCPU.

  • A small Express or Fastify app usually needs tens of MB to a few hundred MB per process, depending on your code and dependencies.
  • Watch for memory leaks: memory that rises steadily in a long-running process is a common Node.js problem. Process managers can restart a process that passes a memory threshold.
  • Builds need more than runtime. Running npm install or a frontend build with tools such as Next.js, Vite or webpack can need 1 to 2 GB or more for a few minutes. On a small VPS, add swap or build elsewhere and deploy the result.

Databases

Databases are where extra RAM pays off most. Reading from memory is far faster than reading from even the fastest NVMe drive, so the goal is to keep your working set, the data and indexes you query often, in memory.

  • MySQL and MariaDB: the InnoDB buffer pool (innodb_buffer_pool_size) is the key setting. On a server dedicated to the database, giving it well over half of the RAM is common. On a server that also runs PHP, keep it much lower so the web stack has room.
  • PostgreSQL: the official documentation suggests about 25 percent of RAM for shared_buffers as a starting point on a dedicated server, with the operating system's file cache doing much of the rest.
  • Redis: the whole dataset lives in RAM, so size the server to the data and set maxmemory with an eviction policy when Redis is used as a cache.

CPU needs for databases depend on query complexity and concurrency. Many small concurrent queries need several cores. A few heavy reports need fast cores and, above all, good indexes.

Signs your VPS is too small

  • Load average consistently above the number of vCPUs, shown by uptime or top.
  • High steal time (st in top), which means the hypervisor is not giving your VPS CPU time when it asks. Persistent high values are worth raising with your provider.
  • Swap in steady use, visible with free -m or vmstat.
  • Out-of-memory kills in the kernel log, which you can find with journalctl -k | grep -i oom.
  • High I/O wait (wa in top), which often points to a database that no longer fits in memory.
  • Pages that are slow only at busy times and fast at night.

Signs it is too big

If CPU stays low even during your busiest hour, and the memory your applications use stays well under half for months, a smaller plan may do. When you check memory, look at the "available" column in free -m, not "free". Linux deliberately fills unused RAM with file cache, which it gives back the moment applications need it.

Scale up or optimize first?

More hardware is the quickest fix but not always the cheapest. Before resizing, check your caching, slow database queries, bot traffic and heavy plugins. If the site is well tuned and still short of resources, upgrading is the right call, and moving one size up with headroom is better than running at the limit every day.

Frequently asked questions

Is 1 GB of RAM enough for WordPress?

It can run a single small site with careful tuning, but it leaves little room for the database, PHP workers and updates. For a VPS that runs the full stack, 2 GB is a more comfortable minimum.

Do more vCPUs make a single page load faster?

Usually not. One PHP request runs on one core, so a slow uncached page stays slow. More cores help when many requests arrive at once. For individual pages, faster cores and caching make the difference.

Should I add swap on a VPS?

A small swap file, for example 1 to 2 GB, is a useful safety net against short memory spikes. If the system uses swap all the time, you need more RAM or fewer workers.

How many websites can an 8 GB VPS host?

It depends on traffic and type, not the count. Dozens of small cached brochure sites can fit, while one busy store may need the whole server.

Hostinq.com's Cloud VPS Starter in Germany, with 4 vCPU, 8 GB RAM and 75 GB NVMe for $24.80 a month, covers many WordPress and small store setups. The VPS Standard plan with 6 vCPU, 12 GB RAM and 100 GB NVMe is available in the US, UK and Asia-Pacific locations, and larger tiers are available everywhere. Compare sizes on the VPS page.

Share: