How to Select The CPU and RAM for Your Web Hosting VPS?

Picking a VPS (Virtual Private Server) for your website isn’t dissimilar to choosing a desktop or laptop computer for your home or office. Basically, what you do is look at hardware configurations and compare features and prices.

However, while you may have a rough estimation of what sort of resources you’ll need for your personal computer, getting the right combination of processing power, memory, and storage for your server may be a bit more tricky.

At the same time, this is critical for the success of your website. Get a server that’s not powerful enough, and you won’t have the performance to match visitors’ expectations. Overspec it, and you’ll be paying for resources you don’t need.

Today, we’ll look into how CPU power and RAM affect your virtual server speed and help you find the right balance.

Hardware Resources in VPS Hosting

Fundamentally, the components powering your web hosting server are the same as the hardware inside your computer and smartphone.

The ones critical for web hosting are:

  • CPU: CPU stands for Central Processing Unit, and it’s often referred to as the server’s brain. Its job is to perform calculations, execute commands, and process data.
  • RAM: RAM, or Random Access Memory, is a device that provides temporary storage for data generated by the operating system and software installed on the server. Data stored in the RAM is used by applications and the server CPU. It can be read much faster than the information on the server’s permanent storage drive.
  • Storage: The SSD (or HDD) drive is the storage device that keeps your files and databases. Unlike the RAM, which is flushed at every reboot, the SSD stores data permanently.

If you use a dedicated server, all these are physical components specified when the server is bought and deployed. With a virtual server, a hypervisor takes these hardware components and splits their resources among several virtual machines.

But how does it work exactly?

In terms of storage, things are fairly straightforward, especially if we’re talking about a standard VPS setup. A hypervisor partitions the physical server’s drive into multiple individual sections and allocates each of them to a different virtual machine.

Distributing RAM among VPSs is similar. The physical server’s memory is split into 1GB chunks, which are allocated to individual virtual machines according to their needs. Not all of it needs to be used at all times.

For example, you may have a physical server with 16GB of RAM and three VPSs running on it – two using 2GB and one taking up 8GB. This means the virtual machines employ 12GB and 4GB are left for future upgrades or new deployments.

When it comes to processing power, things are a bit more complicated. Modern CPUs use a multi-core architecture, which massively improves productivity and boosts processing speeds.

The physical server’s CPU has multiple processing units on the same chip. Allocating one or more of these units to each virtual machine would be inefficient. Physical web hosting servers utilize enterprise-grade hardware, so even a single CPU core may be far too powerful for a regular website. That’s why hypervisors split the processing power provided by a single physical core into multiple virtual ones.

The virtual cores are then assigned to individual VPS solutions. The more cores you have – the more tasks the server executes simultaneously.

How Does RAM Work in the Context of Web Hosting?

Your computer or server’s RAM is a device that stores data. So, it’s only logical to ask: “What’s the difference between the random access memory and the SSD holding your data?“. The answer – speed.

Storage technology has come a long way, but even the most modern SSD drives are still orders of magnitude slower than your server’s RAM. This is partly due to the hardware. 

There are no longer read-write heads, and SSDs don’t have any moving parts. However, permanent storage drives’ speeds are still measured in MB/s while RAM reads and writes data at well over 1GB/s.

There’s a difference in the logic used for storing information as well. SSDs store data in data blocks, which make it easier to organize but slower to read.

By contrast, the “random” in Random Access Memory indicates that any byte of information required is instantly available. The result is lower latency (the time the computer needs to read the first byte of data).

All that speed comes into play when you need to launch an application. In basic terms, a software app is a collection of data as well as instructions telling the CPU how to process it.

By storing the app data in the RAM, the processor can access it more quickly. That’s why when you launch a software application on your computer or phone, its data is automatically loaded into memory, and the CPU reads it from there. The bigger and more complex the app, the more RAM you need.

More of the same thing happens on a web hosting server. Let’s say your website is built with WordPress. Alongside it, you have other components supporting your website, like the web server, the database management system, the PHP interpreter, etc. The server’s operating system also uses some memory to provide the environment where your applications run.

When the server is powered on, data from all these software and applications is loaded into the RAM. When users interact with your website, the information stored there is instantly available, and the processor handles it over to the user’s browser quickly and efficiently.

If data that needs to be sent to the user isn’t available in the RAM, it’s fetched from the SSD.

Caching and RAM

When a user requests a page, the web server has a lot on its plate. First, it needs to interpret the request, locate the required resources, and collect all the static files like images, CSS stylesheets, and JS scripts from the server’s SSD. Then, it has to coordinate the database queries and the execution of server-side scripts that generate dynamic data. Finally, all this has to be returned to the user as a functional HTTP response.

When another user requests the same page, your server has to repeat the same steps. And if hundreds of visitors all access the same page simultaneously, it would have to do it hundreds of times a second.

Given that a lot of the data served to the users is identical, this isn’t the most efficient use of hardware resources. That’s why caching was invented.

If caching is enabled on your site, before the response to the first user is sent, some of the data is copied and stored in the server’s RAM. When the second user arrives, the web server fetches it from the memory instead of going through the same process again.

The impact on the speed is so significant that you’ll struggle to find a website with any meaningful traffic that doesn’t use caching. You should consider enabling it yourself, but make sure you don’t rush the process.

The choice of caching solution and its implementation should be governed by many different factors, including the website-building platform, the volume of dynamic data you need to serve, the traffic you register every day, etc.

How Does the CPU Work in the Context of Web Hosting?

We’ve already established that the SSD and the RAM store data. They don’t really do anything with it. That’s the CPU’s job.

The software applications installed on the server give it specific instructions, and it translates them into actions. Doing that efficiently depends on a few key components.

Key CPU Components

Below, we will review the key CPU components, so you can get familiar with them.

Let’s see more:

  • Control unit: The control unit is the part of the processor that tells the other components how to respond to specific instructions. It receives input information, converts it into signals, and sends them to individual cores or other modules within the processor.
  • Arithmetic logic unit: The arithmetic logic unit does the heavy lifting. It’s responsible for performing arithmetic and bitwise operations. In other words, it completes the instructions handed over by the control unit.
  • Cache memory: The CPU cache is different from the server’s main cache. It’s a hardware device connected to the central processor storing frequently accessed data, which can either be served directly to the user or help complete CPU instructions.

Cloud and virtualization technology emulates the functionality of all these components and ensures your virtual server works as a regular machine.

Virtual or physical, you need to consider a couple of factors when looking at the available hosting options.

Key CPU Characteristics

The clock speed is one of the most important characteristics of modern CPUs. Imagine a checkout line at a supermarket. The speed with which it moves depends entirely on the cashier’s efficiency. The faster they work, the more quickly the customers will go through.

A CPU with a high clock speed (or operating frequency) is like an experienced, well-trained cashier handling customers with immaculate efficiency. A slow CPU is like a trainee on their first day at work.

In other words, the clock speed determines how quickly the processor executes commands and completes calculations.

The number of cores is another very important characteristic. Let’s stick with the supermarket analogy. The queue is still the same, but you open a couple of other tills, and customers start using them as well. More people are going through the checkout process at the same time, so the waiting time is reduced.

This is basically what happens when your server has multiple cores. Requests and instructions are executed by different cores at the same time. More tasks are being handled at once, resulting in faster overall performance.

The CPU speed is usually fixed and depends on the hardware powering your virtual machine. If the physical server’s processor works at 3.2GHz, your VPS will also use the same frequency. A process known as overclocking can theoretically increase it, but it could lead to stability issues, so it’s not considered best practice.

When it comes to cores, things are a bit more flexible. Thanks to virtualization, your hosting provider can split the physical server’s processing power and distribute it among different virtual machines according to their needs.

You can have two virtual servers on the same infrastructure – one with two CPU cores and one with a dozen cores. The only real limitations come from the hardware and the amount of unused processing power.

Choosing the CPU and RAM for Your VPS

Picking the correct hardware configuration means finding a delicate balance that gives you the right power and performance at the right price. You want the resources needed to reach the loading speeds you’re after while also ensuring you’re not paying too much.

When it comes to storage, it’s fairly straightforward. Whether you’re building your site locally or directly on a server, you can easily see how much space it takes up.

With processing power and memory, things are a touch more complicated.

Unlike the storage, the RAM and the CPU are vital in ensuring strong performance. If you get one of them wrong, you can’t expect the other to compensate. Hosting providers will try to help you avoid this by recommending hardware configurations based on your site’s traffic levels. For example, many experts reckon that for every 200,000 monthly clicks, you need 1 CPU core and 2GB of RAM.

These figures aren’t pulled out of thin air. They’re calculated based on years of experience hosting websites on virtual servers.

They can’t guarantee success, though. There are far too many factors in addition to the traffic that contribute to a website’s resource usage, and ignoring any of them could lead to performance issues.

For instance, the software you use to build your website plays a role. In fact, resource usage is often discussed when content management systems are compared.

It is common knowledge that because of its versatility and modular architecture, Drupal is more resource-intensive than WordPress. This suggests that if you’re building a Drupal site, you need a more powerful server than if you want to work with WordPress. However, it’s not quite as simple as that because if you employ a particularly heavy WP plugin, like the Elementor website builder, for example, things could quickly turn the other way.

There are other factors, like the optimization strategies you’ve implemented. If you’re thinking of implementing a caching solution that will cache a large volume of data, you need to prepare and get enough RAM to store the information. However, it’s also worth noting that the more data you cache, the lower your CPU usage, so it’s useful to think about how this might affect your configuration.

All this means is that there isn’t a CPU-to-RAM ratio that you can stick to when choosing your virtual server. The requirements of individual projects are far too diverse, and it’s impossible to come up with a definitive formula telling you what sort of configuration you need.

Luckily, with a VPS, this isn’t that much of a problem.

Checking CPU and RAM Usage and Upgrading Your VPS

One of VPS hosting’s main advantages is its scalability. Your virtual server’s hardware configuration can be updated quickly and easily, so in reality, you’re never more than a couple of clicks away from the hardware resources you need to ensure blistering performance.

But how do you know whether you even need to upgrade the server?

Obviously, a drop in your site’s loading speeds will indicate something’s wrong. However, checking the server load is a more reliable method for determining whether an upgrade is in order.

Your VPS likely comes with a control panel that gives you a lot of detailed information on the current server load.

If you use WHM/cPanel, log in to the WHM administration dashboard, scroll down to the Server Status menu, and click Service Status.

Below the list of active services, you’ll find information on how much CPU resources and memory you’re using.

If you use SPanel, ScalaHosting’s proprietary all-in-one server management platform, the data is even more easily accessible. It’s at the top of the Admin Interface’s homepage.

If your server doesn’t have a control panel or you prefer to use the terminal, you can check the server load by executing the htop command through SSH.

Server load data is vital for your future scaling strategy. It shows you which components may cause a potential bottleneck, so you know exactly what you need to upgrade. It’s up to your hosting provider to ensure you have the flexibility to scale the service in the most cost-efficient way possible. Not all hosts manage to do it.

Some offer services that are segregated into plans. For example, you have an entry-level package with 2 CPU cores and 4GB of RAM, a mid-tier service with 4 cores and 6GB of RAM, and a top-level plan with 8 cores and 16GB of RAM. If you’re using the cheapest VPS and running out of memory – you need to upgrade to the second tier.

This will solve the RAM issue but will also add a couple of additional CPU cores you don’t necessarily need. In other words, you’ll be paying for resources you don’t use.

VPS services built on proper cloud infrastructure are different. The underlying hardware provides an enormous pool of resources and allows hosts to offer an incredibly flexible service that can give you a cost-effective solution at any time.

For example, ScalaHosting customers have the freedom to create fully custom virtual servers with the precise amount of processing power, memory, and storage they need. All they need to do is move the sliders around until they have the correct configuration.

A system like that increases your chances of getting a VPS with enough resources at a reasonable price. If you’re unsure you can do it on your own – do not hesitate to contact our support specialists, who will assist you further.

Conclusion

VPS hosting is, without a doubt, a must for anyone serious about their website. The isolated environment makes it more reliable and secure than shared plans, and when it comes to cost efficiency, the pricey dedicated servers simply can’t compete with it.

However, to make the most of your virtual server, you need to ensure it has the correct hardware configuration. Knowing how the CPU and RAM work will definitely help you do it.

Frequently Asked Questions

Q: How much RAM do I need for my VPS?

A: 2GB of RAM is enough to support a website with around 200,000 monthly hits, though you have to take into account other factors like the caching engine your site uses, the CMS and its plugins, and even the operating system.

Q: How do I set up a VPS for web hosting?

A: If you’re getting your virtual server from a hosting provider, chances are it’s already configured to support websites. It comes with a web server and firewall pre-installed and configured, a database management system, and, more often than not, a control panel that lets you install your CMS of choice and deal with dozens of everyday website management tasks.

Q: How many CPU cores do I need for hosting?

A: A rule of thumb states that 1 CPU core is good for around 200 thousand monthly hits. However, depending on the complexity of your website and the software powering it, you may see a deviation from this estimation.

Was this article helpful?

What’s your goal today?

1. Find the right Managed VPS solution

If you’re looking for industry-leading speed, ease of use and reliability Try ScalaHosting with an unconditional money-back guarantee.

2. Make your website lightning-fast

We guarantee to make your website load in less than 2 seconds on a managed VPS with ScalaHosting or give your money back. Fill out the form, and we’ll be in touch.

Make your website lighting fast—or your money back
Slow websites lose visitors and sales. See how you can surf tsunami sized traffic spikes—or any traffic—with ease with ScalaHosting. Fill out the form, and we’ll be in touch!
Please enter a valid name
Please enter a valid website
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

3. Streamline your clients’ hosting experience

If you’re a web studio or development agency hosting more than 30 websites, schedule a call with Vlad, our co-founder and CTO, and see how we can deliver unmatched value to both your business and your clients.

Photo

Need a custom cluster or professional advice?

Book a meeting and get a free 30-minute consultation with Vlad, co-founder & CTO of Scala Hosting, who will help you select, design and build the right solution - from a single data center cluster to a multi-region & multi-datacenter high availability cluster with hundreds of servers.

Book a free consultation

4. Learn how to grow your website in 2024

An all-star team of SEO and web influencers are sharing their secret knowledge for the first time in years. Learn about the future of SEO, Web Design best practices and the secrets to getting the foundation for your website to thrive. Watch the exclusive webinar.

An Exclusive Insiders Look Behind The SEO and Web Development Curtain