How Much RAM Does a VPS Need for a Website

One of the most common questions when choosing a VPS is: how much RAM does my website actually need? Too little, and the server will start lagging under load or crash entirely. Too much, and you are paying for resources that sit idle. The right answer depends on the type of website, its engine, the number of visitors, and the set of running services. In this article we will walk through specific scenarios and provide practical benchmarks.
Why RAM Is the Key Resource for a Web Server
RAM is the working space of a server. The web server, PHP interpreter, MySQL or PostgreSQL database, Redis cache — they all live in RAM simultaneously. When memory runs out, the operating system starts using the swap partition on disk, which is tens of times slower than even the fastest SSD. Users notice this immediately: pages load with a delay, 502 and 504 errors appear, and at peak moments the site simply stops responding. That is why RAM capacity should be the first thing you evaluate when choosing a VPS plan.
The Basic Calculation Formula
The general principle is simple: add up the consumption of each process, then add 20 to 30 percent as a buffer for peak load and OS system needs. A typical LEMP stack (Linux, Nginx, MySQL, PHP-FPM) at idle consumes between 200 and 400 MB. Under real load, each PHP worker takes between 30 and 80 MB depending on the complexity of the application. If you have 10 workers running, that is already 300 to 800 MB just for PHP. MySQL, depending on its configuration and database size, can consume anywhere from 128 MB to several gigabytes.
That is exactly why you cannot rely on server consumption at idle — it is important to measure RAM under load close to real conditions. Use the free -m command or htop to see the actual memory consumption picture in real time.
RAM Recommendations for Different Types of Websites
A small static website or landing page on Nginx without PHP and a database can run comfortably on as little as 512 MB of RAM. This is the minimum viable option, suitable for simple business card sites, placeholder pages, or small sites built with static site generators like Hugo or Jekyll.
A blog or corporate website on WordPress with moderate traffic — up to 1,000 to 2,000 unique visitors per day — requires between 1 and 2 GB of RAM. WordPress itself is not heavy, but plugins, WooCommerce components, and active PHP-FPM quickly eat up memory. With 1 GB you can already set up a proper stack with caching via Redis or Memcached, which significantly reduces the load on PHP and the database.
An online store on WooCommerce, OpenCart, or Bitrix with a catalog of several thousand items and a daily audience of 3,000 to 10,000 people is already at the 2 to 4 GB RAM level. Here MySQL is actively working with large tables, complex queries are executed in parallel, and without sufficient memory the database will be the first to slow down. If you use Elasticsearch for catalog search, add at least another 1 to 2 GB just for that.
A high-traffic portal, marketplace, or SaaS application with thousands of simultaneous users requires 8 GB or more. At this level, the architecture is usually already distributed across multiple servers: a separate VPS for the database, a separate one for cache, a separate one for the application. Each of them must have sufficient RAM for its role.
How the Technology Stack Affects Memory Consumption
The choice of technology stack directly determines the server's appetite. Apache with mod_php consumes noticeably more memory than Nginx with PHP-FPM, because Apache spawns a separate process for each request. Nginx handles connections asynchronously and uses RAM much more efficiently. If you are still using Apache, switching to Nginx or OpenLiteSpeed can reduce memory consumption by one and a half to two times without changing your plan.
Node.js and Python applications on Flask or Django consume memory differently: the runtime itself takes 50 to 150 MB, but with a large number of simultaneous requests or memory leaks in the code, consumption can spike sharply. Go and Rust applications are traditionally the most economical: a compiled binary with a web server often fits within 30 to 50 MB under real load. Java and JVM applications, on the other hand, require at least 512 MB just to start the virtual machine.
How to Choose a Plan Without Making a Mistake
Experience shows that it is better to start with a plan that seems sufficient and monitor real consumption over the first few weeks. Track RAM usage via htop, free -m, or the built-in tools of your control panel. If average memory utilization consistently exceeds 70 to 80 percent, that is a signal to upgrade — do not wait until the server starts swapping.
When renting a VPS at NodexGo, you can upgrade to a higher plan at any time using the Increase Resources button on the server card — the disk and IP address are preserved, and the process takes just a few minutes. This is convenient: you are not locked into your initial choice and can scale as your project grows.
Find a plan with the RAM you need
View PlansHow to Reduce RAM Consumption Without Upgrading
Before moving to a more expensive plan, it is worth optimizing what you already have. The first step is configuring PHP-FPM: reduce the pm.max_children and pm.start_servers values to what is actually needed. The second step is configuring innodb_buffer_pool_size in MySQL: by default this value is often set too high and takes up a significant portion of RAM. The third step is enabling page caching: plugins like WP Super Cache or Redis Object Cache allow static copies of pages to be served without invoking PHP or hitting the database on every request.
You should also disable unused services and daemons. It is common for a VPS to be running Postfix, Apache (if you have already switched to Nginx), old PHP versions, and other processes that no one configured but that quietly consume memory. The command ps aux --sort=-%mem will show which processes are consuming the most RAM right now.
ps aux --sort=-%mem | head -20Swap: a Safety Net, Not a RAM Replacement
A swap partition on disk is not an alternative to RAM — it is an emergency buffer. When a server goes into swap, performance drops catastrophically: disk operations are tens of times slower than RAM even on NVMe. Nevertheless, swap is useful to have: it prevents the OOM killer from forcibly terminating processes during brief spikes. The recommended swap size is equal to the amount of RAM or half of it, but no more than 4 GB for most configurations.
If your VPS regularly uses swap, that is not normal — it is a symptom of insufficient RAM. Check consumption with the free -m command and decide whether to optimize or upgrade your plan.
free -m
swapon --showSummary: Practical Benchmarks
To summarize: a static site or landing page — 512 MB; a blog or WordPress business card site — 1 GB; a corporate site or small online store — 2 GB; a mid-sized store or portal with active traffic — 4 GB; a high-traffic project — 8 GB and above, typically already spread across multiple servers. These figures are a starting point, not rigid rules: actual requirements depend on the specific code, plugins, database, and traffic patterns.
Choose your plan thoughtfully, monitor metrics after launch, and do not be afraid to scale. At NodexGo you can start with a minimal configuration and increase resources in one click as your project grows — without migrating data or changing your IP. Rent the right VPS right now and launch your website on reliable infrastructure.
Launch a VPS with the RAM you need in minutes
Create Server