VPS memory (RAM)

Memory (RAM) capacity is a major factor in determining the performance of a VPS.

Posted at: 2023.2.21

What is VPS memory (RAM)?

VPS memory is the same as the memory that stores data currently used by the VPS. However, the difference is that VPS memory is virtualized and created from the server's physical memory, which differs from physical servers.

Each VPS is allocated a fixed amount of memory, and this memory is isolated from other VPSs on the same physical server.

What affects memory usage?

The amount of memory required for a VPS depends on several factors, including the number of websites hosted on the VPS, the complexity of the website, and the amount of traffic the website receives.

Therefore, you need to have a good idea of "which processes are consuming memory" on your server.

What are the negative effects of inadequate memory capacity?

In a normal operating system, the CPU processes data while storing temporary data in memory for data processing. Therefore, memory consists of parts that are faster than storage.

If this memory runs out, the CPU stores temporary data in storage, which is a slower storage area if SWAP is set. Naturally, server performance will also be reduced because of the slower read/write speed.

In this case, the server will stop working following the steps below.

  1. website loading speed slows (latency)
  2. the site becomes unresponsive (stuck)
  3. the server stops working (server down)

While it is not common for the server itself to crash in (3), delays and stacks are relatively common phenomena that can occur if the VPS server is not properly configured.

What is the required memory capacity for VPS?

The actual amount of memory required for a VPS depends on how the VPS is used, but generally speaking, the appropriate amount of memory is "within the range of no SWAP even during peak access times.

For small websites with low traffic, 1GB of memory may be sufficient. On the other hand, websites with high traffic or complex web applications may require 4GB or more.

This is a case-by-case basis, but it is recommended to keep the memory size to "1.5 to 2 times the amount of memory used during peak access times" to easily cope with sudden increases in accesses.

This is only a guide, but here is a comparison of the approximate memory capacity that should be chosen for running a website.

We will assume that the site is dynamic, including the database, and that all content, including images, is hosted from the VPS. Access figures include not only users, but also bots such as Google crawlers.

Memory estimatesAccesses/dayAccesses/month
1GB〜1,000PV〜30,000PV
2GB〜3,000PV〜100,000PV
4GB〜10,000PV〜300,000PV
8GB〜17,000PV〜500,000PV
12GB〜30,000PV〜1,000,000PV

The amount of memory required for a server depends on the configuration of the site and how much data it holds; a VPS with 1GB of memory may be able to handle 1 million PV per month, while a VPS with 8GB of memory may not be able to do so.

So, please use this as a reference only.

Points to consider when selecting appropriate VPS memory

Let's try to avoid using unnecessary memory.

First, it is important to use memory appropriately. If you think "not enough memory = let's upgrade", you will be stuck at some stage when you are left with problems (negative legacy) in your program and server, which you have to solve with money.

Let's explore ways to avoid using memory from multiple angles, such as reviewing the program, reviewing server settings, and using external servers such as CDNs.

Let's augment the amount of memory based on the amount of website traffic.

If you are still running out of memory in a situation where you have reduced memory waste, it is most likely due to an increase in the amount of traffic to your hosted website.

If there is a clear increase from the amount of traffic when you signed up for your current VPS plan, do not hesitate to upgrade your plan.

How to increase VPS memory

Keywords for VPS