replication question - connections on slave

From: Aras Targaryen <araskoktas(at)gmail(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: replication question - connections on slave
Date: 2012-09-27 19:55:23
Message-ID: CAC44bgrKg4gbpU0jqGefyspazeqAR20FD70zofRD9vpmUDfmcQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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

Browse pgsql-admin by date

  From Date Subject
Next Message Greg Williamson 2012-09-27 22:05:59 Database size stays constant but disk space keeps shrinking -- postgres 9.1
Previous Message Spike Grobstein 2012-09-27 18:42:45 Re: error during pg_dump