What is high system resource usage?
In this article I'm going to take a few moments to explain what high system resource usage is, and some of the common things that tend to lead to these conditions happening on your server.
What is resource usage?
On servers there is a limited amount of resources available for use at any one given time, for all users on that server. The main resources that we monitor for high usage would be CPU usage, and disk usage.
The processors or CPU cores on a server handle any tasks that your account sends to them, with typical tasks including running a server-side PHP script, connecting to a database, or sending email.
Because there is a set number of CPU cores per server, the amount of time that your account can request processing time from the CPUs is limited on a shared hosting platform. One user monopolizing CPU usage even unintentionally can lead to delays for other user's website requests, so this is why we monitor this usage and send out notices when we see problematic levels of CPU usage.
Once the CPU has processed the instructions for the tasks it needs to complete for your account, it typically is going to require reading or writing information to the hard drive on the server.
Because the hard drive is shared by all the users on the server, excessive read or write requests to the disk can delay other user's requests from getting fulfilled in a timely manner. One user with an excessive amount of un-optimized MySQL queries for example could potentially cause other user's MySQL requests to delay or even time-out, so we also monitor this resource and alert when we notice high usage.
What is high resource usage?
Depending on the level of hosting that you have, either shared, VPS, or dedicated, your acceptable levels of resource usage will be different.
I would recommend reviewing my article on how can I view my account's resource usage for ways that you can review your account's current resource usage levels, and also the acceptable levels of resource usage on each platform.
Common high resource usage problems
There are a lot of common things that could lead to high resource usage problems, and the list below is not meant to be 100% exhaustive, but rather the most common issues to our knowledge we see happening on accounts.
If you encounter a resource usage related problem that is not mentioned here, please use the Your Opinion Matters! form up at the top-right of this article to inform me. This way we can continue to expand our list and make it that much easier for the next customer that has a similar problem.
- Excessive amount of errors.
- Malicious user activity and hacks.
- Inefficient coding of your website.
- Intensive cron jobs or scheduled tasks.
- Unattended forums getting used for spam.
- Heavy disk activity coming from IMAP e-mail accounts.
- Excessive amount of plugins/modules on your application.
- Excessive amount of spam comments, or guestbook entries.
- No form of database caching to reduce duplicate database queries.
- Excessive e-mail spam filtering, forwarding, and BoxTrapper usage.
- Large surges in traffic going to a site not optimized for that level of traffic.
- Search engine crawlers and automated robots activity not being controlled.
- Excessive amounts of CPU processing especially related to image manipulation.
Resolving high resource usage problems
When encountering problems with high resource usage, there are several key things that you want to check to see if your problems can be resolved without having to upgrade to a more robust hosting platform.
Joomla/Mambo - How to Optimize Joomla/Mambo
Gallery2 - Gallery2 Performance Tips
vBulletin - Optimizing your vBulletin forum to run faster
Magento - Notes on Magento's performance *Note: The developer's of Magento have warned about high resource usage, indicating it could be difficult to run on shared-hosting.
General optimizations and best practices
There are several online tools that can help you benchmark your website and provide some good starting points for general optimizations:
Dynamic page caching - Most website applications today will run a PHP/MySQL back-end. The PHP scripts are used to dynamically pull your content out of the MySQL database for your website. Most applications support some form of database caching either natively or via a plugin that can help cut down on duplicate database calls that can lead to excessive resource usage. This allows your site to serve more static HTML content which is quicker to load for your visitors, and less taxing on the server's resources.
Search engines and bot activity - A lot of the time search engine crawlers, and other automated bots that are simply trying to index large portions of the Internet, could be among your highest amounts of traffic. This type of activity can sometimes have the same affect of multiple concurrent users on your website, and unlike humans they usually aren't going to wait a good amount of time before they request your next page, but instead just follow your links one after another until they have the complete site indexed.
You can read about the (robots.txt) file and how to stop search engines from crawling your website, for info on how to help control the way in which search engines crawl your website, and what sections they're allowed to index. If you for instance have an image gallery section of your website with photos of family and friends, that you might not necessarily want the whole world to know about, you can utilize (robots.txt) rules to tell search engines to igore that section of your site.
This is also helpful if you have some sections of your site that could require a lot of database activity or other type of high resource usage activity. That way you can still provide that service to your human visitors, but you're not wasting server resources to try to fulfil a bots requests for the same content.
MySQL optimization - As your database gets more and more usage, over time there can be additional overhead and you might need to re-index, or re-organize your data. The easiest and qickest way to handle this would be by optimizing the database from phpMyAdmin available from your cPanel. Sometimes this alone isn't enough, and a manual re-structuring of your data or indexes might be necessary to keep your database queries fast and efficient.
Typically with database problems we'll alert you if we notice hanging queries from our end, or a sudden increase in resource usage coming from your database activity. In most of these cases your site's code or database design would need to be reviewed by the developer that created your site, as they should have a good understanding of its functionality and what could be causing problems such as "delayed INSERTS" which is a common problem on shared-hosting.
Before either a developer or yourself starts messing around with your database trying to optimize things, it's generally recommend to first get comfortable with learning how to export and import a MySQL database with phpMyAdmin. That way you can always revert back to a good working copy of your database in the event that something is deleted in your optimization attempts by accident.
You should now hopefully have a good understanding of what high system resource usage is. If you continue to experience issues with high resource usage on your current hosting platform, you might be interested in upgrading your hosting plan, that way you would have a higher resource usage limit for your account.
We value your feedback!
There is a step or detail missing from the instructions.
The information is incorrect or out-of-date.
It does not resolve the question/problem I have.
Post a Comment
Do you want to publish a tutorial to our support center?