Обсуждение: replication question - connections on slave

Поиск
Список
Период
Сортировка

replication question - connections on slave

От
Aras Targaryen
Дата:
Hi

I have a replicated slave copy of my database. Our 6 year old - non modular web app does not have the connection selector for our PHP scripts, so PHP opens SQL queries to the default (last connection) made by the scripts. So if i open a connection to the slave somewhere, it would become the latest connection and would break write-queries that defaults to it.

I was wondering if there is a downfall to opening the slave connection first then master, so master would be default. But if there is no read queries on that page i specially direct to slave, the slave connection would be opened for nothing and simply close after script executes. Is this a horrible practice in terms of performance? 

thanks