homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Databases
Forum Library, Charter, Moderator: open

Databases Forum

Multiple DB's
Slowing down the site?

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

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)

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)

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)

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?

Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Databases
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved