Link to home
Start Free TrialLog in
Avatar of danjen
danjen

asked on

MYSQL Max Concurrent Connections

Can someone tell me if the variable setting
max_user_connections is the same as max. Concurrent users?

In my database the max_user_connections is set to 0 in variable settings,
but go to status in myphpadmin it is says Max Concurrent users = 11.

I need to increase this setting if it is only 11. Can someone tell me how to do this?

Thanks
Avatar of michofreiha
michofreiha
Flag of Lebanon image

In order to increase the number of concurrent connections to your MySQL server please do the following:
1- vi /etc/my.cnf
2- add the following line:  set-variable=max_connections=30
3- Restart mysql

Like that you'll increase the number of concurrent connections to 30...

By the way if you do not have this value(set-variable=max_connections) in my.cnf then the number of concurrent connections is unlimited

Regards
Avatar of Kevin Cross
My understanding is the the mysql ini value limits concurrent connections per user account when set to non-zero value:
http://dev.mysql.com/doc/refman/5.0/en/user-resources.html

Not sure on the max concurrent for phpMyAdmin, that may be for all connections.
The default for max_connections is 100, so should not have to increase on the mysql side.  Have to check what this signifies in phpMyAdmin and increase there is that is not per user connections.
Avatar of danjen
danjen

ASKER

what is the difference between max connections and max user connections? my site is going down periodically and my hosting company is saying that it is because I over the maximum number of concurrent users. So  I need to increase that.
login as root (ssh), and in /etc/my.cnf change

max_user_connections=11

to

max_user_connections=30


rebooting to solve this problem is pretty dumb when you can just do

/etc/init.d/mysqld restart
max connections == max number of clients connected concurrently, default is 100.
http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#sysvar_max_connections

max user connections == max number of connections a specific mysql account can have concurrently, default is 0 which is no limit (up to bounds of max connections).
Avatar of danjen

ASKER

ok - so I updated the max_user_connections, but phpmyadmin says 14 now. See below

Connections        ø per hour        %
max. concurrent connections       14       ---       ---
Failed attempts       1       0.85       0.16%
Aborted       130       109.88       20.73%
Total       627       529.98       100.00%

However the variable says set to 30
ASKER CERTIFIED SOLUTION
Avatar of Kevin Cross
Kevin Cross
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of danjen

ASKER

max_user_connections is set to 30, but I will set it back to 0 becuase that is what it was set to before. All of my queries do happen through 1 account, so it sounds like the number that I need to change is the max_connections. Any idea what the max.concurrent users means?
I don't have phpMyAdmin on my system currently to check, but that may be a graphical way to set the max_connections system variable from phpMyAdmin or it can simply control the max number of concurrent users to phpMyAdmin itself for administration which you wouldn't need many as probably just you.
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of danjen

ASKER

Thank you very much! All of your answers were helpful