Published: July 31, 2024 by Lucas Rolff

How we identify performance problems

As a hosting provider hosting thousands of websites. Whether it's WordPress, Magento, Prestashop or even websites made in Laravel. One of the things we see a lot in our support department is to determine or identify why a given website is slow or doesn't work as expected. Whether this is for existing customers or new customers who want their websites hosted by us. We try to find out as much as possible about the performance problems or resource problems that occur.

When you buy hosting with us. Then we obviously try as much as possible that you have a fast and optimally performing website. This also means we often help you free of charge to analyze your website's performance and resource usage to find out where the problems are.

But how do we actually do this? That's what we'll be going over here.

There's a few different ways to measure performance, but we have two main categories, one being "frontend" and the other one being "backend".

Frontend can be anything from large images, videos, external scripts such as Google Tag Manager, Facebook Pixel and more, but also things like too much javascript, which simply slows down the page when it's first loaded by the user. The effect here can be huge for visitors with slow devices such as mobile devices and tablets, but also for those with a slow internet connection.

Backend on the other hand, can be harder to identify the actual problems. This boils down to having to make some kind of profiling of the code being executed. That's not always easy to do in an environment where you can't just go and change a ton of settings. This particularly is true for shared hosting environments. Problems with the backend performance can be caused by using too many plugins that isn't exactly performing optimally within the hooks and filters that you have within the WordPress system. But it can also be things such as unused database queries or external requests that take up a lot of time, such as server-side Facebook Pixel or backend analytics which creates a dependency on the external services. We've also seen certain payment gateways doing an API call for every single pageview, which turned out to be a misunderstanding of how the hook system in WordPress actually works.

Frontend Optimization

Some of the tools we use to identify the frontend performance issues are relatively simple.

We use the Developer Tools that are available in most browsers. It gives a relatively quick overview of the low-hanging fruits that can be optimized. This can be things such as compressing your images or delivering them as WebP or AVIF format which is often significantly smaller than PNG or JPEG.

All our Grid Hosting solutions come with a tool called Photon Optimizer that makes it possible to convert images to WebP or AVIF on-the-fly based on the visitor's browser capabilities. We however do this slightly more intelligent, by trying to figure out the file type that would be the smallest for the particular image. Whether this is WwebP or AVIF depends on some internal settings.

Tools such as SpeedVitals, GTMetrix or Google PageSpeed Insights can also give you an idea of what can be optimized.

You can also use plugins such as LiteSpeed Cache to optimize pages with, where for example lazy-loading of images is supported directly in WordPress, the awesome thing LiteSpeed Cache does is to calculate what your "above the fold" images are, and then to avoid loading them through lazy-loading.

You can also use plugins such as WP-Rocket or Flying Scripts to optimize your pages. All three plugins try to optimize pages based on "best practices". However, most frontend optimization is almost always a combination of both forward and backward optimization to get a page that works optimally. Not all optimizations work for all pages. Therefore, it is important to test such optimizations on a test page. This can be done for both Grid Hosting solutions and our cPanel webhosting solutions using our "1-click installer" function.

Another thing one can do is to use a theme that is optimized for for great performance out of the box. While we generally are not too fond of Elementor based Themes. The "Hello Elementor" theme for example is designed to be fast and optimized for performance.

But we should remember that the choice of too many plugins can have an impact on what actually gets loaded on the page. Often we see people with a lot of plugins activated that they don't actually use, or really don't need.

Backend optimization

For us, backend optimization is much more interesting because it's one of the places where we have a lot of experience over the past 12 years of doing hosting. But also because we've worked with very scalable solutions.

We have several tools at our disposal to help us make profiling of the code that runs on the customer's websites. Some of these are for example Blackfire.io, CloudLinux X-Ray but also tools like Sentry Profiling to collect data over a longer period of time. In coorporation with the customer, we can offer features that will help analyze the backend to then find out where certain performance problems might exist.

All tools we use give different results, some are heavier than others, but they also give you the ability to see individual call graphs and flame graphs to help identify problems.

CloudLinux X-Ray are one of the more lightweight tools to use, it allows us to run the x-ray service for a number of requests or over a period of time. The issue however, is that it doesn't always provide very accurate results. This is largely due to the lack of call graphs and flame graphs, which can sometimes result in a hard time to analytize the problem, or sometimes even give a wrong idea of what the problem is. This also largely boils down to e.g. in WordPress there's a lot of hooks and filters that can result in the code being executed in a very different way than you might expect.

Another tool we use often is Sentry Profiling, both in cooperation with the customers, but also in development of our own systems such as perfgrid.com and hosting-panel.net - this helps us identify what we can optimize over a longer period of time. And gives us different information about the environment at the time when something is slow.

Finally, there's also wp-cli profile which gives us the ability to profile the different hooks and filters that are run in WordPress. wp-cli profile is available for all customers on all solutions, as we offer wp-cli as a part of our standard package.

But we have to remember, that optimization isn't always about slow code. It might also be the hardware or even configuration of the server isn't always the most optimal for the particular website. We have seen examples with colleagues in the industry where they supposedly have both newer and/or better hardware than we do, but migrating the site to us, ends up being quicker. Quite often this boils down to configuration or settings that have made it possible to get more performance out of the website, without actually having to do any changes.

When you're done, we always try to build features that make the websites faster. We check our server configurations on a frequent basis, and always make optimizations where possible. And we offer things such as Redis Object Caching in our Grid Hosting solutions, as this can give in the form of performance for some websites.

Have you got a slow website and would like to find out why? Finally, contact us at support@perfgrid.com, we'll look into it as best we can (kindly and courteously).