Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have already setup 2 ubuntu server 12.04 LTS on my local machine using virtual box and is using the master-slave replication (postgresql 9.1).

  1. = master
  2. = slave

my question is how to apply the load-balancing based on the two database server? I've heard about pgpool2 and pgbouncer, which one should I use?

Thanks guys and sorry I am new to postgres replication.

share|improve this question

migrated from Feb 10 '14 at 0:49

This question came from our site for professional and enthusiast programmers.

Of PgBouncer and PgPool-II, only PgPool-II supports load balancing.

PgPool-II's load balancing supports only read-only queries that meet certain requirements; see the pgpool docs. Additionally, if you start load-balancing queries you are no longer guaranteed to get a consistent view of the database because the replica might be lagging behind the master.

Personally, I'd look into adding a caching layer (memcached / Redis) before doing fiddly things like read-query load balancing.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.