Did you know that a one-second delay in page load time can reduce conversions by 7%?
Or, that Google penalizes slow sites in its search rankings?
These are just some of the consequences of having a poorly performing WordPress site. And one of the main factors that affects your site’s performance is the amount of RAM and number of CPU cores that your hosting plan provides.
But what are RAM and CPU cores, and how do they relate to WordPress hosting?
How can you tell if your site needs more or less of them? And how can you scale them up or down to optimize your site’s performance?
In this article, we’ll answer all of these questions, and more. We will explain what RAM and CPU cores are, how they work, and why they matter for your WordPress site. We will also give you some examples of WordPress sites that require high RAM and CPU resources, and how to scale them accordingly. Finally, we will share some tips and best practices to improve your site’s performance, and avoid wasting resources.
If you want to learn how to make your WordPress site faster, smoother, and more reliable, read on!
Why Do Sites Need RAM and CPU?
RAM and CPU are the main components of your hosting server that determine how fast and reliable your WordPress site is. Let’s see what they do and why they matter.
What is RAM?
RAM stands for Random Access Memory, and is the temporary storage space that your WordPress site uses to load and process data. Every time someone visits your site, WordPress needs to access the database, load the files, and execute the code. All these operations require RAM to store the data temporarily.
RAM is typically measured in Megabytes and Gigabytes. Most cloud providers allow you to configure the amount of RAM available on your server. The more RAM you have, the more data your site can handle at once. This means your site can load faster, handle more traffic, and run more plugins – without crashing or slowing down.
What is a CPU?
CPU stands for Central Processing Unit, and is the “brain” of your WordPress site that executes commands and calculations. Every time someone visits your site, WordPress needs to perform some logic and calculations to generate the output. For example, it needs to check the user’s permissions, apply the theme’s settings, run the plugins’ functions, and so on. All these operations require a CPU to process the commands.
The CPU is measured in the number of cores. The more CPU cores you have, the more commands your site can execute at once. This means your site can perform faster, handle more complex tasks, and run more plugins without errors or delays.
As you can see, both RAM and CPU are essential for your WordPress site to function properly.
However, they also have limits.
The more RAM and CPU cores you have, the more processes you can run simultaneously, and the faster your site can respond to visitors. If your site receives a lot of traffic or runs complex tasks, it might need more RAM and CPU resources than are available on your current hosting plan. This can result in slow loading times, errors, or even crashes.
That’s why you need to choose a hosting plan that provides enough RAM and CPU resources for your WordPress site. You also need to monitor your site’s performance and usage regularly, and scale your resources up or down as needed. In this way, you can ensure that your WordPress site runs smoothly and efficiently at all times.
Which Sites Benefit From More RAM and CPU?
Not all WordPress sites need the same amount of RAM and CPU resources. Some sites are more demanding and complex than others, and they can benefit from having more RAM and CPU resources to run smoothly and efficiently.
Some examples of WordPress sites that require high RAM and CPU resources are:
- E-commerce sites that handle a lot of transactions and inventory. These sites need to load and process a lot of data, such as product details, prices, images, reviews, cart items, payment methods, and so on. They also need to handle a lot of user requests, such as adding items to the cart, checking out, updating orders, etc. All these operations require a lot of server resources to avoid slow loading times, errors, or crashes.
- Membership sites that have a lot of users and content. These sites need to store and manage a lot of user data, such as profiles, preferences, subscriptions, activities, etc. They also need to load and display a lot of content, such as posts, pages, videos, podcasts, courses, etc. A large amount of traffic will put additional strain on a server’s resources.
- Media sites that stream or download large files. These sites need to handle a lot of bandwidth and storage for the media files, such as images, audio, video, etc. They also need to encode and decode the files for different formats and devices. All these operations require a lot of RAM and CPU resources to deliver high-quality media without buffering, lagging, or breaking.
- Multisite networks that run multiple WordPress sites on one server. These sites need to share the same server resources for all of the sub-sites in the network. This means that each sub-site needs to have enough RAM and CPU resources to function properly without affecting the other sub-sites. Running multiple sites requires a large amount of server resources.
- If your site experiences a sudden surge in traffic, such as during a launch, promotion, or viral event, you might need to scale up your RAM and CPU resources to handle the increased load. In this way, you can avoid slow loading times, errors, or crashes that can frustrate your users and hurt your conversions.
- If your site runs complex plugins or tasks, you might need to scale up your RAM and CPU resources to run them smoothly and efficiently. In this way, you can avoid performance issues, bugs, or conflicts that can affect your site’s functionality and user experience.
Measuring Performance Gains
It’s widely believed that “a bigger server will obviously outperform a smaller server”.
To put this to test, we created 3 identical websites on 3 fresh servers using WordPress 6.2. All of the servers had identical configurations – except the CPU and RAM.
We ran load testing benchmarks using Grafana k6 to stress test the performance of our website, and measure the impact in 95 percentile response times. Since the purpose of this test is to put strain on CPU and RAM, we didn’t use any optimization techniques such as caching that are used in real world applications.
1v CPU 2 GB RAM
Our smallest server used the cheapest hosting plan offered by the cloud provider. It consisted of only 1 virtual CPU and 2 GB of RAM. Despite this, it was able to serve nearly 20 requests per second and had a p95 response time of 815ms. This is not bad considering it only costs <$5 to run. Most users will be able to afford it and will be satisfied with it – as long as the site doesn’t get too much traffic.
2v CPU and 8 GB RAM
Our second server was moderately priced, this one consisted of 2 virtual CPU cores and 8GB of RAM. This server size is probably unnecessary if you’re running a hobby site, but if you use your site for critical business transactions, then you should consider this.
Just by slightly increasing the resources, we were able to see a massive jump in the performance. The server completed nearly 36 requests every second with a p95 response time of 104ms. These numbers suggest that our server was limited by the number of resources during our first test. Let’s crank it up further and see if the numbers scale proportionally.
8v CPU 32 GB RAM
Our third server was the most expensive of the three, it contained 8 virtual CPUs and a whopping 32 GB of RAM. However, when we look at the numbers, they tell a different story. The number of requests per second metric saw only a minor bump from 36 to 39; furthermore, the p95 response time metric didn’t improve.
Trade Offs to Consider While Scaling RAM and CPU
You also need to be aware of the potential drawbacks or challenges of scaling RAM and CPU cores.
Unexpected Crashes
Scaling RAM and CPU cores might cause some unexpected issues or conflicts that can break your site.
For example, you might encounter compatibility problems with some plugins or themes that are not optimized for the new resources. Or you might face some server errors or configuration issues that prevent your site from loading properly.
These issues or conflicts can make your site inaccessible or unusable until you fix them, or revert to the previous state.
Planned Downtime
Furthermore, many hosting providers require you to shut down your server before you can increase or decrease your server’s RAM and CPU.
This means that your site will be offline for the duration of the upgrade. Although most providers will be able to scale up your server within a few minutes, this does vary from vendor to vendor, and depends on availability.
Increase in Hosting Costs
Finally, scaling RAM and CPU cores can also affect the price of your hosting plan. Some providers and plans might offer flexible or scalable pricing that adjusts to your resource usage. Others might charge you a fixed or flat rate regardless of your resource usage. And others might have different tiers or levels of pricing that correspond to different amounts of resources.
You need to weigh the costs and benefits of scaling, and find the best balance for your site’s budget and needs.
You need to consider how much scaling will improve your site’s performance and user experience, and how much it will increase your hosting expenses. You should also compare different providers and plans to find the one that offers the best value and quality for your site.
More Resources Might Not Benefit the Site
Simply adding more RAM and CPU cores does not guarantee better performance if there are other limiting factors such as network speed, disk speed, or PHP workers.
PHP workers are processes that handle PHP requests on your WordPress site. Some hosting providers limit the number of PHP workers available on your server. If you have too few PHP workers, your site may become slow or unresponsive when there are many concurrent visitors or complex tasks. If you have too many PHP workers, they may consume too much RAM and CPU resources, and cause your server to crash.
Final Thoughts – Thinking Beyond RAM and CPU
It’s clear that you can’t keep scaling up the hardware and expect proportional increase in performance.
Throwing money at the problem only works up to a point.
Beyond that, you need to fine tune your application to consume fewer resources, and find the optimal balance between RAM, CPU cores, and PHP workers for your WordPress site based on your traffic, content, and plugins. There are several ways to do this:
- You can use caching, a technique that can improve your WordPress performance by storing frequently accessed data in memory or on disk, and serving it faster to visitors without invoking PHP workers.
There are different types of caching such as page caching, object caching, edge caching, etc. You need to choose the right caching solution for your WordPress site, depending on your needs and preferences.
- You can consider using third party plugins such as Autoptimize for scanning your website for inefficiencies.
- You might also benefit from reading our Knowledge Base article on How to Fix High Resource Usage.
- If the above solutions don’t work for you, you can also consider using a load balancer for WordPress.
If you’re tired of managing your own servers, you might want to check out RunCloud (yep, that’s us!).
RunCloud is built for developers that want to focus on shipping great work, not on managing their infrastructure. Experience what a painless server configuration feels like – get started with RunCloud today, and get up and running in minutes.