Postgres Read replica not used


#1

I set up read replicas in japan and india to improve performance.

DISCOURSE_DB_SOCKET: ''
DISCOURSE_DB_USERNAME: discourse
DISCOURSE_DB_PASSWORD: XXX
DISCOURSE_DB_HOST: prd-etg-XXX.rds.amazonaws.com
DISCOURSE_REDIS_HOST: prd-etg-XXX.cache.amazonaws.com
DISCOURSE_DB_REPLICA_HOST: prd-etg-jpn01.XXX.amazonaws.com

I’m currently accessing our website in Japan and it seems my read replica is never used by discourse.

In our AWS admin console i see that I have no active transaction, no connection.

How can i check if my replica is correcly used in discourse?

Thx
Seb


(Matt Palmer) #2

What makes you believe Discourse utilises a read replica under normal operation? We’ll want to get that documentation fixed.


#3

Under config/discourse_defaults.conf I can find these two settings:

# host address for db replica server
db_replica_host =

# port running replica db server, defaults to 5432 if not set
db_replica_port =

Did I misunderstood something?


(Bhanu Sharma) #4

Yes!

Those replicas are to be used when your master is not available to handle requests.


#5

:slight_smile: okay makes sense!