Welcome to WebmasterWorld Guest from 54.144.243.34

Forum Moderators: open

Multiple DB's

Slowing down the site?

   
6:55 pm on Feb 17, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hey all - I've got a site with several scripts / programs installed that each have their own DB. The site is getting to be kind of slow, and I think (correct me if I'm wrong) that part of the issue might be that for each user, the server ends up having to open multiple database connections.

For example - I have a database for phpbb and wordpress. I also have a db for some custom site stuff.

Does it make sense to put all the tables into one 'master' database? That way, in theory, a user is just opening up one call to the db.
2:06 pm on Feb 18, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



hi matt,

we are often doing the same, but instead of opening multiple connections, i only open one database connection then reference the other databases in the query. e.g.

SELECT field FROM database1.table1
SELECT field FROM database2.table1

the mysql user must have select permissions on each database.

tbh i am not actually sure whether this will improve performance though.
5:45 pm on Feb 18, 2011 (gmt 0)

WebmasterWorld Senior Member rocknbil is a WebmasterWorld Top Contributor of All Time 10+ Year Member



While it's possible, I'd first check the resources - some shared hosting conditions can do this no matter what you do. If it's on a VPS, you should be able to monitor what's slowing it down.

Can you try temporarily disabling one resource or the other during slow times? That is, temporarily shut down Wordpress and see if other pages improve.

I doubt a single database would improve anything.
5:50 pm on Feb 18, 2011 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I suppose its not so much a single database as it is a single db user accessing the db. Where as right now for each db I have a different user setup...So one person visits, if I understand correctly, this would spawn 5 sessions hitting mysql?
 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month