| Multiple DB's Slowing down the site? |
madmatt69

msg:4268573 | 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.
|
jamie

msg:4269023 | 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.
|
rocknbil

msg:4269120 | 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.
|
madmatt69

msg:4269125 | 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?
|
|
|