0

I was requested to split a MySQL in two, it's kind of a horizontal partition, in which some rows correspond to one site, and some other correspond to another site.
But they want to split it in two DBs in the same MySQL server.
I'm no DB expert but I guess keeping them in the same MySQL server with the same amount of memory and processor and the same platform won't improve things.
What we're trying to avoid is the "Too many connections" problem.

3 Answers 3

3

Running multiple instances on the same server would not be recommended as a solution to a connection limit.

If you mean multiple databases on the same instance on the same server that's primarily an architectural consideration and not necessarily a direct solution to a resource issue.

It sounds like your server has to be tuned. I've provided connection tuning recommendations before, this should help:

How do I set my.cnf in Mysql so that there are no limits to connections?

1
  • Thanks. Yes, I mean the second, two DBs in the same instance.
    – Petruza
    May 21, 2010 at 14:54
2

You should investigate why you're running out of connections, first and foremost. Do clients grab a connection and then hold it for a long time? Does each child of a web server have its own connection, or does the server manage a connection pool?

I recommend turning on the general query log to investigate - it records connection details. Note that you probably don't want to have the general query log on in general production use!

Having multiple databases on the same server doesn't change the connections to the server.

Increase connections only because you genuinely have some large number of clients who are known to manage connections properly. However, it most cases, "too many connections" indicates a client-side problem.

1
  • Thanks, I'm not too much in control of the servers, actually we develop a site in php and only have access to the DB via phpMyAdmin, so there's not much we can do about server tuning and configuration. I was requested to split the DB and I was just justifying my position about that procedure.
    – Petruza
    May 21, 2010 at 19:08
1

You are correct, that won't help a connection problem (assuming you mean two dbs and one mysql binary running, not two different mysql installations on the same hardware, which might help but is a totally backwards way of doing it...)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .