connection simultané illimité

hybrid56

Member
Jun 24, 2011
16
0
51
mysql simultaneous connection limit

Hello,

How to limit concurrent connections for some mysql package?
The default is unlimited?
 
Last edited:

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Do you mean max_connections and max_user_connections variables for /etc/my.cnf file? If you set both, then MySQL will be limited for the maximum number of total MySQL connections on the server for max_connections and for the maximum number of database user connections per database for max_user_connections.

If you do revise or add those settings to /etc/my.cnf file, please ensure to restart MySQL upon changing / adding them.
 

hybrid56

Member
Jun 24, 2011
16
0
51
In the file there

[mysqld]
set-variable = max_connections=500
log-slow-queries
safe-show-database
You advise which configuration for 200 accounts?
Server 4 core, 8GB ram
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
I would advise:

Code:
max_connections = 512
max_user_connections = 100
I'm selecting 512 if this is what you have set for WHM > Apache Configuration > Global Configuration area for the MaxClients setting there. Otherwise, you should use whatever for max_connections that would match that of MaxClients, since you cannot have more MySQL connections maximum than Apache connections maximum.
 

cPanelTristan

Quality Assurance Analyst
Staff member
Oct 2, 2010
7,607
40
248
somewhere over the rainbow
cPanel Access Level
Root Administrator
Where did you receive this error message? MaxClients is an Apache setting rather than a MySQL setting.
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter