This article serves as a guide to how you can troubleshoot performance issues you may be having on your website.
Usually, this means you've noticed pages are loading slower that usual, or perhaps you've had customer complaints around slowness.
Websites can be large, complex applications with numerous integrations with third-party services. If you don't have all the right data, you'll be looking for a needle within a haystack. Or worse, wasting time on the wrong problem.
You need to identify whether the performance issues are due to increased traffic/load on the web server or an issue within the application.
CMS vs Website
A common inquiry is whether platform updates to the CMS can introduce performance issues on your website?
Agility (the CMS) and your website, by design are entirely decoupled from one another. This means a slow website won't affect your CMS, and vice-versa. Updates to the CMS cannot break your website.
If you have a performance issue, it is one of two issues:
- Issue within the application code
- Web server is overloaded from high traffic
If a recent deployment co-insides with performance issues, it is recommended to rollback your deployment to a previous state and see if that resolves the performance issue. If it does, this will allow you to review exactly what has changed.
Check Your Site Speed
Check your Google Analytics Site Speed Reports.This will tell you exactly what pages are slow for your users.
This will allow you to focus your efforts and determine whether this is a site-wide problem or only isolated to a subset of pages.
Does your site speed indicate a performance issue across all pages?
If your page load time for all pages is consistently high, this would indicate there is likely an issue related to the web server's resources being maxed out, or some common application logic that is slowing down each page.
If there is only a few pages that have high page load time, this would indicate that there is some logic ONLY on those pages that is causing a high page load time and you start your application investigation there.
Note: Page load time is a combination of backend and frontend timings.
Check Your Server Metrics
It could be that your web server's resources are being maxed out and is affecting the performance of your application. If you are hosting your website, check the CPU of the server. It should never be higher than 80% for a sustained period of time. If you CPU is low (i.e. 1-40%) this should indicate that there is not a problem with the web server and further attention should be placed on the application.
Note: It is perfectly normal to have very high memory usage (i.e. 80-90%) for an Agility website, since there are many built-in caching systems that keep data readily available in memory.
Is your web server's CPU high (i.e. > 80%) while you have logged performance issues?
If you have a high CPU, this will cause slow page load times. This may indicate that there is an issue in the application eating too much CPU, or simply the web server is not able to handle the amount of traffic and needs to be upgraded.
If you have high CPU, you need to test whether this is due to increased traffic. Test this by checking your Google Analytics and seeing if the high page load times correspond to increases or spikes in traffic.
If the performance issues are inline with a traffic spike, there may still be some improvements that can be made in the application to scale better such as advanced caching techniques. However, a quick resolution could be to scale up the hosting environment until performance improvements can be made.
If your performance issues DO NOT correlate to increased traffic, this indicates an issue in the application itself and needs to be investigated.
What is the average response time for the web server?
The average response time for the web server is a good indication of whether the cause of high page load times is backend or frontend related. If the average response time is high (i.e. > 500ms) then this indicates an issue in the backend of the application. If the average response time is low, but the overall page load time from Google Analytics is high, then this indicates an issue in the frontend of the site such as blocking JS, CSS, or images.
Is your web server's CPU low, but you still have slow response times?
This indicates that the web server is not out of resources, but there is something else that is causing high page load times. An example of this could be a server to server call to a third-party resource. If the external resource is providing a slow response time, this would block your application from loading the page until it has received a response.
Other Things to Check
Do you have a Proxy Involved?
In some cases, websites may be behind a proxy. It is important to know if you are behind a proxy or not so that you can test if the proxy is causing a poor response time.
Test the response time of the proxy. Is it a high response time? If the answer is yes, and your web server CPU usage is low-medium, then your issue is squarely with the proxy and you should contact the administrator of that service.
Media & Documents (CDN)
Typically, all of your images, pdfs and other assets are served from Agility's Content Delivery Network. None of these assets are served through the same web server as your website. Are your images loading correctly and have a satisfactory load time? If not, please contact email@example.com as this could be related to a platform service issue.
Test Locally to find Performance Issues in your Application
Even if you've narrowed your focus, it can still be difficult to pinpoint performance issues in your production website. Part of what makes this difficult is that Agility has Output Caching enabled by default so that means that even if a page was slow to load one time, the next time it might be instant because it is returning the page from cache (memory).
While Output Caching does wonders for helping sites scale to meet increased traffic demands, it can make it difficult to test consistently on production.
To get around this, you will want to Find Performance Issues locally in your Application.