It’s frustrating to put dozens of hours of work into a website only to find it sluggish and unresponsive. Trying to determine why it is happening can be even more infuriating – but we’re here to help. This guide will cover testing your website performance, the elements that affect it, and why good performance is important in the first place. We’ll cover:
- Why website speed is important
- How to test your website speed
- How to fix a slow website
- Upgrading your server hardware
Why is website performance important?
It may not seem like a big deal if your visitors have to wait another second for a page load, but it impacts more than just their frustration. Studies show that a faster website leads to a significantly higher conversion rate, with a study by Walmart suggesting a 2% improvement in conversions for every one-second improvement in page load time. That may not sound like a lot, but over a year, that could be thousands or even hundreds of thousands of dollars of lost revenue.
Beyond that, however, webpage performance can affect your search engine ranking. Google has been using page speed as a ranking tool on both mobile and desktop for several. While a slow page with good content is still likely to rank, a fast page with good content will likely always rank higher. So, how do you tell if your website is “fast enough”?
Testing your website speed
While the page load statistics found in your browser’s developer mode can be helpful, testing from your home computer isn’t always the best indication of your customer’s experience. Your physical location and device hardware can have a major impact on page load times and won’t give you any recommendations for improvement.
The best route is, therefore, to use Google’s official PageInsights tool. It stands to reason that if you’re in a good position by Google’s own standards, you’re more likely to rank.
You should be looking at the results of this test to see what technical changes you or your developers can make to your website to improve its speed, with stats like first contentful paint particularly important. You do not need to have a perfect score here, but if your performance is 60 or below on mobile or desktop, you likely want to make some improvements.
How to fix a slow website
If you make Google’s recommended changes to your website code and your pages are still loading slowly, it’s likely your server that is limiting your performance. There are several improvements you can make to address this.
Upgrade your server hardware
Most people choose the cheapest web host possible when they’re starting their website. This is understandable, as it can be difficult to justify the cost of an expensive shared hosting plan when you have yet to generate any revenue. The truth, however, is that you may be better off forgoing shared hosting entirely.
In a shared hosting plan, the resources used to serve your website to users are shared with other hosting customers in your server “block”. As resources are dynamically allocated between sites as needed, your website speed can suffer if somebody else is experiencing heavy traffic. Additionally, shared web hosts often provide good value entry-level plans but make it expensive to scale, which is rarely good for business.
While upgrading your shared hosting plan will help your site performance, if your server is the limiting factor, it’s worth considering switching to a VPS provider instead. This is typically more expensive at the entry level than shared hosting but offers better performance and can be less costly as you scale.
To determine whether you need to upgrade your server, you should be looking as aspects such as:
- Memory: Is your server often getting close to its memory limit? This could be a sign that you need to upgrade your server or optimize/reduce the services running on it. If your server is using too much RAM, it will struggle to process requests quickly.
- CPU: Most websites don’t require too much CPU power, but if you have a heavy database or lots of dynamic content, it could be a limiting factor. Check your CPU utilization if your web host allows you to, and test with a processor with higher core clock speeds if possible to see if this helps.
- Storage and disk I/O: Disk speed is an important factor in website speed, as slow storage will limit how quickly your server can serve resources to users. Disks can only handle a certain number of I/O operations per second, and your users are going to feel it if they have to wait for an interaction to finish before your server can get to them. Most hosts use powerful SSDs, but if you’re using a cheap host or you’re low on storage space, you could still feel the effects. Check your I/O and storage utilization to make sure.
- Bandwidth: Some web hosts have bandwidth caps that control how much data your server can transfer at once. As every user uses bandwidth when they browse your site, this can start to cause issues once you scale to hundreds or even thousands of viewers, particularly if they are downloading a lot of data (i.e. your site has a lot of videos or images).
If you do decide to upgrade, make sure it is necessary and proportionate. Hosts usually make it much easier to upgrade than downgrade, and you don’t want to be stuck paying for an expensive plan you don’t need because you had one month of high traffic.
Increase swap space
If your server is running into memory limits but you can’t upgrade it quite yet, increasing your swap space may help. Swap space is dedicated space on your drive that acts as a holdover when you max out your memory – temporarily storing the data that would have been in RAM. Swap space is much slower than RAM and should not be a permanent solution, but if you are experiencing frequent crashes, it might help to prevent them in the short term.
Optimize your database
If your database is bloated, unoptimized, or not hosted on strong enough hardware, it will affect the speed at which your server can retrieve and serve data to users and therefore slow your website down, too. Database optimization is complex, so many opt to brute force the issue by just throwing more resources at the database. A better choice in some cases, however, may be to hire a database expert to perform tasks such as:
- Optimize queries to reduce their optimization times
- Improve your database indexes for faster retrieval
- Minimize redundant data retrieval
- Partition larger tables
This will reduce the chances you have to upgrade your database as every couple of months as you scale.
Use a CDN
If your server is located on the other side of the world to your user, it will not load as fast. There are, of course, several variables that can affect how significant this slowdown is: not least the reliability of the internet infrastructure along the route. But a rule of thumb is that the further a user is away, the higher the latency will be. This can be addressed with a service called a Content Delivery Network (CDN).
A CDN uses a network of high-capacity servers across the world to mirror content to a location closer to the user. This reduces load times and doesn’t have to cost a fortune – some hosts, such as Cloudflare, even have a free plan.
Protect from DDoS attacks
If your site is suddenly slow, don’t rule out the idea that it is malicious. A distributed denial of service (DDoS) attack on your server can make your website very sluggish indeed if you do not have the proper protection to mitigate it. To confirm an attack, you should use a network monitor application and check for floods of packets such as TCP SYN-ACK, ICMP, FIN, etc. DDoS protection often costs extra, but some DDoS protected VPSs have it built in.
Remove unused applications and plugins
If you’re using WordPress or another CMS, there’s a good chance you’ve installed a dozen plugins, some of which you probably don’t need anymore. Now might be a good time to vet which plugins you have installed and which are really essential. Every plugin uses storage space and server resources, so you should try to ensure that the ones you install offer a significant benefit. You may also want to check for applications and services you have installed on the server itself and forgotten about.
Closing words
To summarize, website performance is key if you want to maintain click-through rates and search engine rankings. A good first step is to run your website through Google’s page speed insights and make any remediations suggested there. If the issues persist, then it’s time to look at factors such as server hardware, swap space, database optimization, CDNs, DDoS mitigation, and unused plugins.
When implementing changes, it’s good practice to back up regularly and make note of any original settings and plugins you had. If in doubt, better hardware will almost always result in better performance – but don’t be afraid to get an expert to look at your site to avoid issues as you scale.