Help - Search - Members - Calendar
Full Version: MYSQL connection limits
The Planet Forums > Control Panels > Plesk
nibb
Hi, is there a way using plesk that MYSQL databases have a limit on simultaneos connections. I know some webhosts do this to limit connections to databases. I think i will need to do this, because i have only a few clients but traffic is not balanced beetween them. So have 0 traffic but then some users have forums,wich sucks all database connections. On single user with a forum that has 80 simultaneos users can leave the server without connections. I have set the simulteanos connections higher every time on MYSQL but that is not the solution, a server will not handle xxx connections. Everything has a limit. So i was thinking of putting a limit per database or per account. Are you a webhost? How do you limit these clients that are heavy traffic with databases. Most script know requires MYSQL, and website with tons of traffic is just not $$$ having it on the server. But know more and more clients that sign up are just these type of clients, and i cant reject users because they have forums for example. I really have a ? on my head about how do others users of The planet that are webhost handle this. If someone can comment on this it would be nice since i really plan on buy more server but this is my biggest problem know. Too many connections to database.
kfukasawa
QUOTE
You can add the following line to your MySQL configuration (/etc/my.cnf) file to set your maximum connections limit.

set-variable = max_connections=<# OF CONNECTIONS>


Doh!!! Sorry bout that. I mis-read your original post. Please ignore that.
Matt2k
Franz Kafka!
Be careful if you get him pissed
Franz! Franz Kafka!
He'll smite you with metaphor fists!
Writing all he can, he's just a man
A warrior of words taking a stand
tekprio
Perhaps the max_user_connections would be more appropriate for you. It limits the number of connections per user. Put the following in /etc/my.cnf

max_user_connections=20

You can change 20 to whatever limit is applicable for your server.
nibb
The max_user_connections like you said could do it. Does this limit a specific user of a database ? Or connections per database itself?. The connections would be simultaneos ones right? Like max_user_connections=20 would limit to a max of 20 simultaneos users.

It would be nice if i can limit per domain, but if i can limit per database it oks too. For example every database can have only 20 simultaneos connections, this would be the same for users itself then right?
tekprio
It is the limit of numer of simultaneous connections per user, not per domain nor per database. Usually, a domain may have multiple databases, and a database may have multple users. But in practice, you can find a reasonable limit and use that as a maximum connections allowed for your particular configuration.
nibb
Are sure that works? I have set
set-variable=max_user_connections=xx

But i think its not affecting anything. I see forums on my server that still have over the limit i set.
kfukasawa
What version of MySQL are you running?
nibb
3.23.58 I think.
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Invision Power Board © 2001-2009 Invision Power Services, Inc.