pgpool2 load balancing not working - Mailing list pgsql-general

From Greg Donald
Subject pgpool2 load balancing not working
Date
Msg-id CAO+WgCZXuEU9Xqmg_Mcfh51v3aYTdwvM+oS2sgNCXq3O0rBbYw@mail.gmail.com
Whole thread Raw
Responses Re: pgpool2 load balancing not working  (Lonni J Friedman <netllama@gmail.com>)
Re: pgpool2 load balancing not working  (Tatsuo Ishii <ishii@postgresql.org>)
List pgsql-general
Sorry if this is the wrong list, but I've been stuck for a couple days
now.  I tried pgpool-general but that list appears to not like me.
I'm not getting any posts and my post hasn't shown up in the archives.

I have a Python/Django app that will require database load balancing
at some point in the near future.  In the meantime I'm trying to learn
to implement pgpool on a local virtual machine setup.

I have 4 Ubuntu 12.04 VMs:

192.168.1.80 <- pool, pgppool2 installed and accessible
192.168.1.81 <- db1 master
192.168.1.82 <- db2 slave
192.168.1.83 <- db3 slave

I have pgpool-II version 3.1.1 and my database servers are running
PostgreSQL 9.1.

I have my app's db connection pointed to 192.168.1.80:9999 and it works fine.

The problem is when I use Apache ab to throw some load at it, none of
SELECT queries appear to be balanced.  All the load goes to my db1
master.  Also, very concerning is the load on the pool server itself,
it is really high compared to db1, maybe an average of 8-10 times
higher.  Meanwhile my db2 and db3 servers have a load of nearly zero,
they appear to only be replicating from db1, which isn't very load
intensive for my tests with ab.

ab -n 300 -c 4 -C 'sessionid=80a5fd3b6bb59051515e734326735f80'
http://192.168.1.17/contacts/

That drives the load on my pool server up to about 2.3.  Load on db1
is about 0.4 and load on db2 and db3 is nearly zero.

Can someone take a look at my pgpool.conf and see if what I'm doing wrong?

http://pastebin.com/raw.php?i=wzBc0aSp


I'm starting to think maybe it has something to do with Django
wrapping every request in a transaction by default, but when the
transaction only has SELECTs, shouldn't that be load balanced just
fine?  Makes my stomach hurt to think I may have to turn off
auto-commit and manually commit transactions all throughout my code :(
 Still hoping it's a pgpool setup issue, since it's my first time
setting it up and all.


Thanks.


--
Greg Donald


pgsql-general by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Large number of rows in pg_type and slow gui (pgadmin) refresh
Next
From: Kirk Wythers
Date:
Subject: recasting to timestamp from varchar