High server load from website scripts: causes and how to reduce it
PrintIn short: a website "loads the server" when its scripts use more processor time, memory, database queries or simultaneous processes than the hosting plan allows. The site then slows down or shows errors, and in serious cases the script can be stopped or the account suspended. The cause is almost always inside the site: no page cache, a heavy or outdated plugin, aggressive bots, a badly scheduled task or a bloated database. Below is how to find which one it is and what to change.
How excessive load shows up
- The site becomes slow, mostly at busy hours: see slow website: what to fix first.
- Visitors get the "Resource Limit Is Reached" page (error 508): see Resource Limit Is Reached.
- You receive a message from TopHost support about high load from your account. In it we name the scripts or processes involved, so start with those.
- In the most serious cases the account is suspended: see hosting suspended.
Why we say the cause is in the site
When a site is slow, we first look at the server as a whole. If the overall load is normal and the other sites on the same server respond quickly, the problem lies in the scripts of that one site. CloudLinux gives every account its own share of CPU, memory and processes, so one site cannot slow down its neighbours, but it does hit its own ceiling. What each limit means is explained in the Resource Usage limits.
Step 1. See when and how the limits are hit
- In cPanel, open Metrics, then Resource Usage. Look at which limit was reached (CPU, memory, entry processes, IO) and at what times.
- Compare those times with the access log (Metrics, then Raw Access) or with Awstats. Many requests in a short time from the same addresses point to bots; heavy load at night points to scheduled tasks.
- Check Errors in Metrics, or the error_log file in the site's folder. Repeated PHP errors often come from one plugin; see finding the faulty plugin in error_log.
- Think about what changed recently: a new plugin, an update, a product import, an advertising campaign, a newsletter with a link to the site.
Step 2. Fix the most common causes
No page cache
Without a cache, every visit runs PHP and dozens of database queries again. On WordPress Hosting and Business Hosting, turn on LiteSpeed Cache: setting up LiteSpeed Cache. On Web Hosting SSD, use the cache built into your CMS or a caching plugin. In Joomla, the page cache is set in System, Global Configuration, on the System tab.
Outdated or heavy extensions
Old versions of a CMS and its plugins are slower and more often abused. Update them, for WordPress first from cPanel with WP Toolkit. Then look for the heavy ones: statistics and "related posts" plugins that query the database on every page, page builders with many add-ons, security plugins running frequent full scans, backup plugins working on the live site. Deactivate them one at a time and watch Resource Usage.
Bots and crawlers
SEO crawlers and badly behaved bots can open thousands of pages an hour, especially endless combinations of filters and search results in online shops. How to recognise and limit them: too many bots on your website. Password-guessing on wp-login.php and xmlrpc.php also creates load; protection is described in WordPress security.
Scheduled tasks
- In cPanel, open Advanced, then Cron Jobs. Remove duplicate tasks and those running every minute without a real need.
- WordPress runs its own scheduler (WP-Cron) on visits. On a busy site, turn it off by adding
define( 'DISABLE_WP_CRON', true );to wp-config.php, and add a cron job every 15 minutes instead, for example:curl -s https://example.com/wp-cron.php?doing_wp_cron > /dev/null 2>&1(put your own domain in place of example.com).
The database
Tables that grow without limit (revisions, logs kept by plugins, expired temporary data, old sessions) slow down every query. Clean them with the CMS's own tools or a dedicated plugin, after you have taken a copy of the database. In phpMyAdmin you can select the tables and choose Optimize table from the "With selected" list; if a table is reported as damaged, use Repair table. Large tables without indexes are a job for the developer.
Old PHP version
Newer PHP versions run the same code noticeably faster. If the CMS and plugins support it, choose a recent version: PHP version selection.
Infected scripts
A sudden load with no change on your side can come from malicious code that sends spam or attacks other sites. Check the account as described in finding malicious code on your site.
If you received a load notice from us
- Read the list of scripts and processes in the message and start with them.
- Apply the matching fix from Step 2 or pass the message to the site's developer.
- Reply in the same ticket with what you changed, so we can check the load again.
Under the TopHost Terms and Conditions, when an account uses significant resources we contact the client. If the use is excessive (memory, processor, SQL queries) and can destabilise the server, the account can be suspended or the script disabled without prior notice, to keep the server running for everyone. Acting quickly on our message avoids that.
Frequently asked questions
The site worked for years without changes. Why is there load now?
The site may not have changed, but its surroundings have: more content in the database, more visitors, new bots, plugins left without updates. A database that has grown for years is a frequent cause.
Is it time for a bigger plan?
If the site is optimised (cache on, extensions updated, bots kept in check) and Resource Usage still shows the limits reached during normal traffic, then yes. Asking for a plan with more resources is up to the client: upgrading your plan. For projects that have outgrown shared hosting, see when you need a VPS.
Can you tell me which script is the problem?
Yes. Open a support ticket with the site address and the time the problem occurred, and we will look at the processes recorded for your account.