2.6.1.3.4. Error max_user_connections
Each database user can establish a limited number of concurrent connections to the database. The error "User 'example_db' has exceeded the 'max_user_connections' resource (current value: XX)" occurs when attempting to establish a new connection beyond the current limit (specified in parentheses in the error message).
Standard limits
Standard limit values:
- Shared hosting — 50 (on all plans). Warning! If the permissible load is exceeded, the limit may be reduced until the load returns to normal.
-
- Business 2G — 120.
- Business 4G — 180.
- Business 6G — 200.
- Business 8G — 200.
- Business 16G — 400.
- Business 32G — 400.
You can only change the limit by upgrading to a higher business hosting plan. However, keep in mind that simply changing your plan and increasing the limit does not guarantee that the problem will be resolved. If your site is making too many database connections, we recommend first identifying the root causes of this behavior by reviewing the site's code. Increasing the limit without analyzing the problem may result in the new limit being quickly exhausted as well, or other resources (CPU or RAM) being depleted.
Common causes of this problem
- High consumption of server resources:
- 100% utilization of allocated CPU resources.
- 100% usage of allocated RAM.
- Slow and resource-intensive database queries.
- Numerous database connections created by site scripts or third-party software.
Searching for possible causes
- Check the resource usage graphs for high load levels. If high resource consumption values are observed, you should take measures to resolve them, as high load can cause problems for all sites in the hosting account.
- Problematic queries are logged and displayed in the hosting control panel under the "Slow queries" section. This may be caused by either an improperly constructed query that is inherently quite heavy or a non-optimized database structure. You should consider optimizing the queries themselves and the database.
- If you have checked the previous two causes but have not observed any signs of them, you should try temporarily changing the database password to prevent new connections from being established. In this case, after a short while, all connections will be terminated, and you will be able to connect to the database for further maintenance and troubleshooting. If it is difficult to determine exactly what is causing this issue, you should gradually update the connection password to the current one in all scripts and software that use this database with the same user, and check whether the problem reoccurs.