[Pgpool-general] Master/Slave Load Balancing Configuration
Yoshiyuki Asaba
y-asaba at sraoss.co.jp
Fri Jan 4 09:19:53 UTC 2008
Hi,
From: Ow Mun Heng <Ow.Mun.Heng at wdc.com>
Subject: Re: [Pgpool-general] Master/Slave Load Balancing Configuration
Date: Fri, 04 Jan 2008 17:06:36 +0800
>
> On Fri, 2008-01-04 at 17:57 +0900, Yoshiyuki Asaba wrote:
> > From: Ow Mun Heng <Ow.Mun.Heng at wdc.com>
> > > Setup :
> > > Slony 1 master, 1 slave - pg8.2.5, slony 1.12
> > > pgpool - 2.01
> > > OS : centos 4
> > > Goal : SLony for replication
> > > Pgpool for load balancing across multiple slaves+1master
> > ...
> > > listen_addresses = '*'
> > > port = 9999
> > > replication_mode = true
> >
> > If you use Slony-I, you need to set replication_mode to false.
>
> > Can you set the following setting?
> >
> > replication_mode = false
> > master_slave_mode = true
> > load_balance_mode = true
> > backend_hostname0 = 'pgmaster'
> > backend_port0 = 5432
> > backend_weight0 = 0.2
> > backend_hostname1 = 'pgslave1'
> > backend_port1 = 5432
> > backend_weight1 = 0.8
>
> Actually, I did try this, (following the docs) but for the life of me, I
> was not able to see/determine if load balancing was actually
> happening.
I cannot reproduce it in my environment.
% pgpool -n -d -f pgpool.conf &; sleep 5; psql -p 9999 -c 'select 1' postgres
...
DEBUG: pid 28641: select_load_balancing_node: selected backend id is 1
...
LOG: pid 28641: statement: select 1; *** select slave node ***
DEBUG: pid 28641: waiting for backend 0 completing the query
DEBUG: pid 28641: read_kind_from_backend: read kind from 0 th backend T NUM_BACKENDS: 1
DEBUG: pid 28641: pool_process_query: kind from backend: T
DEBUG: pid 28641: read_kind_from_backend: read kind from 0 th backend D NUM_BACKENDS: 1
DEBUG: pid 28641: pool_process_query: kind from backend: D
DEBUG: pid 28641: read_kind_from_backend: read kind from 0 th backend C NUM_BACKENDS: 1
DEBUG: pid 28641: pool_process_query: kind from backend: C
Can you show us debug log?
Regards,
--
Yoshiyuki Asaba
y-asaba at sraoss.co.jp
>
> I did (more than) a few sample queries to see where I'm querying (eg:
> Same table, but the tables has different data _just_ to see where pgpool
> is sending the queries) but all I ever found was that all the queries
> were going into pgmaster.
>
> The debug logs did not show anything which says otherwise either.
>
> additionall "show pool status" also does not show anything interesting)
>
> pgpool -h
> pgpool version 2.0.1(heemauli)
>
> But I will give it the benefit of a doubt and retry again. Please tell
> me how to see that it is working. Many Thanks.
More information about the Pgpool-general
mailing list