Web Hosting Talk







View Full Version : How can I limit MySQL Connections for any account in Linux server


kmh465
12-03-2001, 06:26 PM
How can I limit MySQL Connections for any account in Linux server ?
Like
http://www.venturesonline.com/hosting/virtual-hosting.html

they limit MySQL Connections=45 . for each pakage.

alchiba
12-03-2001, 07:44 PM
Basically, like this when you start the daemon:

safe_mysqld -O max_connections=45

See also: http://www.mysql.com/doc/S/e/Server_parameters.html

kmh465
12-04-2001, 01:59 AM
thanks,
but
is 45 for each user ? or for the server ?

and How can I increase thim for a user and decrease it for another .?

eva2000
12-04-2001, 03:38 AM
sorry but

max_connections - server wide

is not the same as

max_user_connections - applies to each mysql user

you'll need to add max_user_connections variable and value to your /etc/my.cnf file

kmh465
12-04-2001, 03:44 AM
Originally posted by eva2000
sorry but

max_connections - server wide

is not the same as

max_user_connections - applies to each mysql user

you'll need to add max_user_connections variable and value to your /etc/my.cnf file

eva2000
if I add :
max_user_connections = 40
will be apply for all users ?
and can I increase thim for a user and decrease it for another .?

eva2000
12-04-2001, 03:55 AM
Originally posted by kmh465


eva2000
if I add :
max_user_connections = 40
will be apply for all users ?
and can I increase thim for a user and decrease it for another .? applies to all users you can't pick and choose

unless you place a user specific ~/.my.cnf file in that users root directory http://www.mysql.com/doc/O/p/Option_files.html

kmh465
12-04-2001, 04:10 AM
thanks,

what is the ability of max_connections for Redhat Linux system ?
PIII1 ghz , 256RAM
PIII1 ghz , 512 RAM
PIII 1 ghz , 1 gb RAM

JDF
12-04-2001, 07:34 AM
Originally posted by kmh465
thanks,

what is the ability of max_connections for Redhat Linux system ?
PIII1 ghz , 256RAM
PIII1 ghz , 512 RAM
PIII 1 ghz , 1 gb RAM

I'd like to know this too... anyone? ( without 1000 "what if's" plz ;) )

StarGate
12-04-2001, 08:35 AM
Originally posted by JDF


I'd like to know this too... anyone? ( without 1000 "what if's" plz ;) )

In the same (my.cnf) there is a setting of how much RAM will be assigned to perm connections. Just multiply with this value and until you reached the amount of RAM you have in the system (or better say FREE in the system cause system needs RAM too u know :rolleyes: ) and there you have your max possible connections.

Ah and one tip how to render the whole MySQL limitations useless. Just use connect instead of pconnect (for VBB just disavle pconnect in config.php) and all you db connections will be terminated after use so you will never have more then lets say 10 connections to MySQL parallel when before with PERM connection it was lets say 100-150 :D