Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9105919
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T02:12:57+00:00 2026-06-17T02:12:57+00:00

I have a Python/Django app that will require database load balancing at some point

  • 0

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, quite 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:8000/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 config and see if what I’m doing wrong?

backend_hostname0 = '192.168.1.81'
backend_port0 = 5432
backend_weight0 = 1
backend_data_directory0 = '/var/lib/postgresql/9.1/main'
backend_flag0 = 'ALLOW_TO_FAILOVER'

backend_hostname1 = '192.168.1.82'
backend_port1 = 5433
backend_weight1 = 1
backend_data_directory1 = '/var/lib/postgresql/9.1/main'
backend_flag1 = 'ALLOW_TO_FAILOVER'

backend_hostname2 = '192.168.1.83'
backend_port2 = 5434
backend_weight2 = 1
backend_data_directory2 = '/var/lib/postgresql/9.1/main'
backend_flag2 = 'ALLOW_TO_FAILOVER'

load_balance_mode = on

My entire config is here:

http://pastebin.com/raw.php?i=wzBc0aSp
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T02:12:58+00:00Added an answer on June 17, 2026 at 2:12 am

    I needed

    replication_mode = off
    master_slave_mode = on
    

    Thanks to Tatsuo Ishii:

    http://www.pgpool.net/pipermail/pgpool-general/2013-January/001309.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have been writing some a django project / app that initiates some test
I've started building an app in Django that will require multi-criteria weighted ratings. My
I have a Django app written in Python 2.5 and I plan to upgrade
django 1.4,python 2.6.6. I have an app jobs. my files tree: djproject/ |-- djproject
I have a Python program (with Django - does this matter?) that I want
I need to have an at-home project now that I'm working on Python/Django at
hi i am working on a django python application using sqlite3 database. I have
I have java sdk 1.7. I've always used django/python for web development, this will
I have a Google app engine in python form submit that POSTS text to
I have a Django app that takes tweet data from Twitter's API and saves

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.