It can be that your website reaches the so-called resource limits. When your website use that many resources that the limits are being reached, you will be notified upon visiting your website, indiciating that your website is unreachable because the server experiences a high load. The website is then temporarily blocked and will become reachable again once resource usage is below its limits. In this manual, we would like to explain what you can do in such situations.
What are resources?
First, what are resources exactly? Think for example of CPU or memory usage. Just like a computer program on a computer, a website also uses memory and calculation power of a server.
How many resources you have available, is dependent on the hosting package that you own. When resource limits are being reached, it can be that you have simply grown out of your package. You can then consider to scale up to the next package with more resources.
What are possible causes?
It can be that there is a problem within the website which makes you reach these limits. There are different causes. Often these causes are a heavy plugin, a script, a cronjob, an inefficient website, or a large number of simultaneous visitors. Below, these causes are explained further.
Plugin or script
A frequently occurring problem is that a plugin or script is stuck in a loop, which reaches the maximum amount of resources. Especially plugins which display images and/or edit them, such as gallery plugins, can eat up a lot of memory.
Cronjob
It is also possible that a wrongly configured cronjob (within DirectAdmin or your CMS) demands a large portion of the resources, which has limiting as a consequence.
Large number of simultaneous visitors
When there suddenly are a large number of simultaneous visitors, because your website has reached the news or knows a huge surge in popularity, limits can also be reached.
Within our packages you have, dependent on the kind of package you are using, a maximum amount of resources you can use. When your package is too small, it might be interesting to take a look at a package which has more resources.
Inefficient website
Another common cause is that the website is not set up properly. Think for example of a website which uses a large number of unnecessary plugins, a website which is not using caching, or a website with a very large database.
How can I solve it?
Investigate the issue
Before tackling the problem, it is important to conduct a thorough analysis. You can answer the questions below to do so:
- Did I change something recently on the website? Is there for example an update or a new plugin installed?
- Are these problems new or did they start from a specific date?
- Is the website being visited a lot by just one IP-address?
- Were there any (PHP) errors within the website before the issue arose?
- Is there maybe a backup from before the problems started?
Check the resource usage
You can find a lot of information in DirectAdmin to sort out the problem. We can use the option 'Resource usage' for this. Here, it is logged exactly how many tax is coming from the package.
- Log into DirectAdmin.
-
Within the menu, go to 'Extra functions', then 'Resource usage' and in the next screen, click on 'Details'.
- You will then see an overview of different graphs. Here, you can see when and which part of the resources are causing te problem. Below on the page, you will find a complete overview of the values which were set on specific times. You can also see further back in the past (which is set to 24 hours standard), up to 30 days.
When resources have been limited, there is a proces or processes in the website, which take too many resources. Do consider that when a limit is being reached, that processes are being delayed. Delaying processes can in turn lead to reaching the limit on entry processes, because the processes are stacking.
Check the log files
When investigating the problem, always check the log files which are available in your hosting package. Keep an eye out for PHP errors which you can find in the error log. Try to redirect these problems to the cause of the issue. For example due to an error in the PHP code, script or plugin which is causing it.
Check the PHP version
Check in DirectAdmin within the PHP selector which PHP version you are running. If you are for example still running on 8.0 or below, it is recommended to check whether you can switch to a newer version.
Solving resource problems
By first getting clear what causes the problem, it is then usually easy to address the problem. Based on your earlier analysis, you have most likely found the plugin, script or IP address responsible.
Plugin
If the cause is a plugin, consider (temporarily) disabling the plugin or removing it altogether and search for an alternative.
If your website cannot be reached anymore due to the plugin, you can best disable this within the 'File Manager' within DirectAdmin. You can do so by finding the folder of the plugin and renaming this one, by for example adding .old behind it (e.g. /wp-content/plugins/test becomes /wp-content/plugins/test.old).
Cronjob
When your research shows that the problem arose from a cronjob, it is sensible to disable and review it. When a cronjob is the cause, you can take these steps when reviewing it:
- Adjust the timeframe in which the cronjob runs.
- Check the script for any bugs.
- Is the cronjob still relevant? If not, keep it deactivated.
It is also possible within WordPress that there is a wp-cron which is the cause. You can disable it in the following manner:
- Log into DirectAdmin and go to the File Manager.
- Open the public_html folder.
-
Find the wp-config.php file and add the following code (or change it to the syntax below) and save it:
define('DISABLE_WP_CRON', true);
Once you have done so, wp-crons will not be run anymore. If it is a wp-cron you are actively using, it is better to make a regular cronjob for this.
Inefficient website
If there are no errors on the website, but there is still a resource problem, it is possible that the website is not set up correctly. This can be due to a lot of loose parts being loaded, or too many plugins. Even with a minimum number of requests, this can lead to limitation.
There are a number of steps you can take to make your website more efficient.
- Reduce the number of active plugins within the website.
- Make sure caching is set up properly.
- Optimize your database.
Nuisance of one IP address
When the nuisance is coming from a single IP address which is requesting the website by an extreme amount, you can block this within your .htaccess-file. You can add the following code to the file (which you can find in your public_html folder):
order allow,deny
deny from 111.111.111.1
deny from 222.222.222.22
deny from 333.333.333.333
allow from allOf course, replace the IP addresses above with the specific IP address you retrieved from the logs. The list of blocked IP addresses can be as long as you want.
Support
If there are still problems despite all the steps above, please reach out to us at support@partners.one. We are happy to help!