Search

Language:  
Search for:

Available article translations:

"Too many connections" error in the Parallels Plesk interface

Article ID: 769, created on Oct 6, 2008, last review on Feb 9, 2015

APPLIES TO:
  • Plesk for Linux/Unix
  • Plesk for Windows

Symptoms

The following errors occasionally appear in the Parallels Plesk interface:

Unable to connect to database: Too many connections

SQLSTATE[08004] [1040] Too many connections

Cause

This error means that the maximum number of simultaneous connections to the MySQL server has been reached. New connections to the server cannot be established at this time.

Resolution

There are two ways to solve this issue. The first is to increase the connection limit, and the second is determine the cause of the "Too many connections" error and use that information to lower MySQL server usage.

The MySQL server status can be checked using the mysqladmin utility. For example, to find out the number of current connections to the server, use:

# mysqladmin -uadmin -p`cat /etc/psa/.psa.shadow` extended-status | grep Max_used_connections
| Max_used_connections | 11 |

The current connection limit can be found using:

# mysqladmin -uadmin -p`cat /etc/psa/.psa.shadow ` variables | grep 'max.*connections'
| max_connections | 100 |
| max_user_connections | 0

In the above example, the maximum number of connections to the server (max_connections) is set to 100. The maximum number of connections per user (max_user_connections) is zero, which means unlimited. The default MySQL values can be redefined in /etc/my.cnf (/etc/mysql/my.cnf on Debian/Ubuntu). For example:

[mysqld]
set-variable=max_connections=150
set-variable=max_user_connections=20

Restart MySQL after my.cnf has been modified:

/etc/init.d/mysqld restart

Please note: if you set the connection limit to a very high value (more than 300), this may affect server performance. It is better to find and rectify the cause of the unusually high MySQL server usage. You can check which users/requests slow MySQL on all current connections with the following command:

# mysqladmin -uadmin -p`cat /etc/psa/.psa.shadow` processlist

Search words:

New configuration files for the Apache web server were not created due to the errors in configuration templates

plesk mysql import db issues

Website down

Too many connections

PleskFatalException

send db adapter exception

Unable to connect to database

MySQL Said: #1040 - Too many connections

user xxx already has more than 'max_user_connections'

common_func.php3:150

zend db adapter exception

ERROR: Zend_Db_Adapter_Exception: SQLSTATE[08004] [1040] Too many connections (Abstract.php:144)

plesk hang every 120 sec




a914db3fdc7a53ddcfd1b2db8f5a1b9c 29d1e90fd304f01e6420fbe60f66f838 56797cefb1efc9130f7c48a7d1db0f0c 85a92ca67f2200d36506862eaa6ed6b8

FEEDBACK
Was this article helpful?
Tell us how we may improve it.
Yes No
 
 
 
 
 
 
Server Virtualization
- Odin Cloud Server
- Odin Containers for Windows 6.0
- Odin Virtuozzo Containers
Automation
- Odin Automation
- Odin Automation for Cloud Infrastructure
- Odin Business Automation Standard
- Odin Virtual Automation
- Odin Plesk Panel Suite
- Web Presence Builder
- Odin Plesk Automation
- Odin Small Business Panel
- Value-added Services for Hosters
- Odin Partner Storefront
Services & Resources
- Cloud Acceleration Services
- Professional Services
- Support Services
- Training & Certification