How to check why my website runs slowly

Sometimes, a website runs slowly. Occasionally, an error 500 (Internal server error) or 508 (Resource limit is reached) occurs, and it’s unclear what causes it. There can be many reasons. In cPanel on smarthost.eu, you can diagnose many of these causes by yourself.

One way to verify where the problem lies is to use a built-in option available in cPanel that allows to check which files are causing the server to be overloaded.

To check the load on the hosting account, go to Resource Usage under the Metrics tab in cPanel:

Go to the [Details] or [Snapshot] tab.

Here you can check on a specific day, at what times there were server overloads and what caused them.

Each client has fixed, exclusive parameters assigned to them (processor memory, number of processes, disk read), so if any of these parameters spike to the set limits, you need to look for a solution within the application.

[Details] Tab

In this tab, you can see resource usage over a period of time. This period can be set to view anything from the “last 10 minutes” to any specified date range.

[Snapshot] Tab

Process List – shows the files causing the load and assigns them values indicating the percentage of CPU and memory usage each file contributes.

In the screenshot below, you can see that the index.php file in the public_html directory is consuming both RAM and CPU resources.

The most common reasons for high CPU and RAM usage are:

– Poor website optimization

– Sudden increase in website traffic

– Incorrect PHP/Cron process settings (triggering at the same time)

– Excessive number of plugins

Error 500

This is a message that usually occurs when something unexpected happens on the server, and the server itself cannot send specific information. The website displays an error message instead of the normal page.

Most common causes:

– Incorrect permissions for directories and files,

– Database connection error,

– Exceeding available server resources,

– Incorrect entries in the .htaccess file.

Error 508 (Resource Limit Is Reached)

The 508 error occurs when server resource limits are exceeded due to the client’s application load. The 508 error usually appears due to misconfigurations on the user’s side, causing excessive resource usage.

Most common causes:

– DoS or DDoS attack on a specific site,

– Attacks on unsecured login forms, xml.rpc files,

– Lack of website optimization,

– Poor quality templates/themes/plugins that generate many parallel calls instead of aggregating queries and calls,

– Using database queries without indexes or very “heavy” queries that take a long time to execute,

– Hosting many regularly visited websites on a single hosting account,

– A significant increase in legitimate website traffic.

Most of the above causes can be diagnosed in cPanel under the “Resource Usage” icon.

Solutions that can improve website performance:

1. Website optimization

A website often requires optimization both in terms of code and to address overloads caused by high traffic, which can lead to database connection interruptions and exceeded limits. It’s important to pay special attention to database queries, as the lack of proper indexes can significantly slow down the website’s performance. If in doubt, consult the developer responsible for building the website.

2. Reducing file sizes

To ensure smooth website operation, it’s also important to optimize images and files, as large file sizes can significantly impact website performance. It’s recommended that images do not exceed 1MB in size, and choosing the right image format is crucial.

3. Reducing the number of plugins

When using popular CMS systems (e.g., WordPress, Joomla), you have access to many plugins, but having too many can cause a significant drop in website performance. Therefore, it’s recommended to use only the plugins that are absolutely necessary. Unnecessary add-ons should be disabled (or better yet, removed entirely).

4. CMS application updates

Applications should be regularly updated due to ongoing performance improvements and optimizations in newer versions.

5. Implementing cache

Caching can greatly increase website speed. By using cache, some files are saved on the user’s computer, which significantly improves performance when reloading the page. Cache is crucial – it can be server-side (e.g., using Redis, Memcached engines, or file cache with the use of plugins such as W3 Total Cache for WordPress). It is also possible to enable cache for some of browser’s elements on the client-side.

6. Reducing HTTP Requests

When users visit a website, the browser makes several requests to load each of these files, which significantly affects the page loading speed. In this case, it’s important to minimize the .js, .css, and image files.

7. Changing PHP Version

Very often, older versions of PHP are used, which nowadays have a negative impact on website performance. It is recommended to switch to the latest PHP version, which should significantly improve the website’s performance.

We discuss the latest PHP versions and how to change them for individual applications in this article:
It is worth taking care of the current version of PHP. How should it be changed correctly?

8. Increasing Account Parameters

It may happen that the current parameters of the hosting account (RAM, CPU, EP) are not sufficient. In such a situation, you might consider increasing the parameters (We write about how to increase them here) or upgrading to a more powerful VPS or dedicated server.


VPS server wizard: business VPS server
Dedicated server wizard: prestahosting.pro and woohost.eu

Summary

There are many factors that can affect slow page loading and various errors, most commonly poor website/application optimization. Therefore, it is crucial to identify what is causing the slowdown and errors, and to eliminate these problems as quickly as possible.

Krzysztof Wojtal
Latest posts by Krzysztof Wojtal (see all)