[pgpool-general: 9281] Re: Load balance question.

Tatsuo Ishii ishii at postgresql.org
Wed Nov 27 09:23:57 JST 2024


> I have 2 servers. 1 primary master and 1 slave(read-only). The slave is
> replicating from the master.
> 
> I am trying to configure a pgpool server. I already started the server, but
> the all query are been sent to the primary.
> 
> How can i configure to send the read query to the slave?

You need to enable load_balance_mode to on (that's the default).  If
you want to send the read query to standby as much as possible, you
should set:

backend_weight0 = 0

> i have backend_flag0 = 'ALWAYS_PRIMARY' but everything that i put on
> backend_flag1 for the slave give error, except 'ALLOW_TO_FAILOVER', i have
> tried 'SECUNDARY' and 'slave'.

ALWAYS_PRIMARY is a setting for failover, not load balancing.

> Also i have the setting load_balance_mode =0.

This kills the load balancing feature. If you want to enable load
balancing, set it to on.

Best reagards,
--
Tatsuo Ishii
SRA OSS K.K.
English: http://www.sraoss.co.jp/index_en/
Japanese:http://www.sraoss.co.jp


More information about the pgpool-general mailing list