High MySQL database usage on shared hosting accounts

As a shared hosting customer, you may receive messages from the Smart System Notifier about high MySQL usage. This article discusses possible causes and ways to resolve the issue.

Smart System Notifier messages

As a shared hosting customer, you may receive an e-mail message from us if your database usage far exceeds average database usage on the server. This Smart System Notifier message informs you of conditions that impact the performance and stability of your account and the server that hosts it. By informing you of these conditions early, we can work together to improve your account's performance and stability before the issue impacts the entire server.

Possible causes of high MySQL usage

A simple explanation for high MySQL usage is that your account's site or sites receive a lot of traffic. In other words, your site is popular, which is good news! If this is the case, please contact our Sales team to discuss possible upgrade options.

However, in other cases, high CPU usage from database processing is unintentional and caused by other factors. The following list describes some common software issues that can cause high CPU usage from database processing. Resolving these issues does not require an upgrade:

  • Recent changes to the website may have included database queries that are too resource-intensive. This can be caused by a new custom query that you or your developer wrote. For more information about MySQL optimization, please visit http://dev.mysql.com/doc/refman/5.0/en/optimization.html. Another cause can be “plug-ins” for a content management system or other application. If you have activated any plug-ins recently, it is worth trying to disable them temporarily to see if the issue resolves. Similarly, you can disable plugins one by one to narrow down where the issue lies.
  • Running cron jobs too frequently—particularly resource-intensive cron jobs—can negatively impact MySQL performance. Only run cron jobs as often as necessary. On shared hosting accounts, the shortest allowed interval for cron jobs is 15 minutes.
  • Comment spam on a forum or blog such as Wordpress can affect MySQL usage. Check your account for any old installations that you can remove, or for comments and spam postings that look automated. On most blogs, it is possible to disable commenting. If you want to allow comments, however, you may need to implement CAPTCHA protection for your website. For more information about how to do this, please see this article.
  • Search engine spiders “crawl” your website. If this occurs too frequently, performance may be affected. Please make sure that your robots.txt file contains a Crawl-delay setting of 30 seconds or higher. For example:
    User-agent: *
    Crawl-delay: 30
  • A hacked account often causes abnormal MySQL usage. Make sure you use a secure password and keep all software up to date. For information about how to secure a hacked site, please see this article.
  • Make sure you keep all installed web applications up to date.
  • If none of the previous scenarios apply to your account, it may just be outgrowing what a shared server can handle. You should consider upgrading to one of our affordable Managed VPS plans.
MySQL limits on shared servers are adjusted occasionally for optimal performance. MySQL query execution time is currently limited to 30 seconds.

Did you find this article helpful? Then you'll love our support. Experience the A2 Hosting difference today and get a pre-secured, pre-optimized website. Check out our web hosting plans today.

We use cookies to personalize the website for you and to analyze the use of our website. You consent to this by clicking on "I consent" or by continuing your use of this website. Further information about cookies can be found in our Privacy Policy.