What is MySQL Overloading?
When your website uses a database in order to serve your users, you are using MySQL to make that happen. In order to keep the databases working fast for everyone, we periodically check the amount of load on each database server.
When a database gets overloaded, that means that too many MySQL requests have been made to the server in a period of time, slowing the database server, and client websites, down.
Why did my website hit this limit?
When our automated system detects that a database has been overloaded, we check to see which accounts are placing the most load on the database server, and suspend them for 24 hours. Additionally, our servers may suspend your account if they detect that you have sent more than 10,000 database queries in the last 60 minutes.
If you have been suspended for overloading the database, that means that your website was making too many database queries in a period of time. One thing to note is that our database servers have massive capacity, and can handle periods of high-load. Because of this, it is rare that a website does get suspended for this limit, and if you do, read on to the list of possible reasons below.
There are many reasons why your website may have been doing this, the most common reasons are listed below:
- Your website makes too many MySQL queries on a page-load
- Your website received in influx of visitors, causing an increase in MySQL queries
- Your MySQL queries are complicated, and take multiple milliseconds for the database to process them and return a result
How do I prevent my website from hitting this limit?
Before you can optimize your website, you first need to figure out what is sending the queries to the database. Is it code that you created, or is it code from a script such as WordPress?
The queries were not coded by me (WordPress, OpenCart, etc)
- Remove unnecessary plugins, especially plugins that you recently installed.
- Locate a way to cache data on your site. Some applications have an option to cache the result of a database query, so the query is not sent more than once.
- Figure out what settings on your site may be causing extra database load, and disable them if you don’t require them
- Delete plugins instead of disabling them
If you continue to get suspended and the above steps are not possible, you may have to upgrade to premium hosting.
The queries were coded by me (Custom built software)
- Use the least number of queries as possible, and make sure to use WHERE clauses effectively
- Don’t create more than one database connection. Establish one connection, and use it in your entire site
- Don’t import or output large database files (Such as backups) using MySQL. Instead, run these tasks from PHPMyAdmin
If you continue to get suspended and the above steps are not possible, you may have to upgrade to premium hosting.
When will my website be unsuspended?
Websites suspended for overloading the database are unsuspended after 24 hours. A site cannot be unsuspended earlier upon request.