How to use pgbouncer

Started by Adarsh Sharmaover 15 years ago6 messagesgeneral
Jump to latest
#1Adarsh Sharma
adarsh.sharma@orkash.com

Dear all,

I am not able to find any useful document regarding Configuration and
Running Pgbouncer with Postgres-8.4.2.

How it helps and is it able to boost some performance ?

Or if there is another useful tool available for Connection Pooling.
Please guide me for this.

Thanks & Regards

Adarsh Sharma

#2Filip Rembiałkowski
filip.rembialkowski@gmail.com
In reply to: Adarsh Sharma (#1)
Re: How to use pgbouncer

2010/12/21 Adarsh Sharma <adarsh.sharma@orkash.com>:

Dear all,

I am not able to find any useful document regarding Configuration and
Running Pgbouncer with Postgres-8.4.2.

that's strange, there are several good pages on the web; there is also
my mini-howto:
http://filip.rembialkowski.net/pgbouncer-mini-howto-benchmark/

How it helps and is it able to boost some performance ?

PgBouncer is a connection pooler. I wonder why do you want to use it,
if you don't know what it is?

it can help in many ways, two most obvious points:
- reduce number of postgres backends (more resources for the server)
- reduce cost of single connection from the application to postgres

Or if there is another useful tool available for Connection Pooling. Please
guide me for this.

yes there are some; see
http://wiki.postgresql.org/wiki/Replication,_Clustering,_and_Connection_Pooling

it depends on what you need. pgbouncer is the smallest and most
lightweight pooler available.

FR

#3Richard Broersma
richard.broersma@gmail.com
In reply to: Filip Rembiałkowski (#2)
Re: How to use pgbouncer

2010/12/21 Filip Rembiałkowski <filip.rembialkowski@gmail.com>:

Or if there is another useful tool available for Connection Pooling. Please
guide me for this.

yes there are some; see
http://wiki.postgresql.org/wiki/Replication,_Clustering,_and_Connection_Pooling

it depends on what you need. pgbouncer is the smallest and most
lightweight pooler available.

Also, Pgbouncer is the only connection-pooler that work on MS-Windows
that is released for production use.

--
Regards,
Richard Broersma Jr.

#4Andreas Kretschmer
akretschmer@spamfence.net
In reply to: Richard Broersma (#3)
Re: How to use pgbouncer

Richard Broersma <richard.broersma@gmail.com> wrote:

2010/12/21 Filip Rembiałkowski <filip.rembialkowski@gmail.com>:

Or if there is another useful tool available for Connection Pooling. Please
guide me for this.

yes there are some; see
http://wiki.postgresql.org/wiki/Replication,_Clustering,_and_Connection_Pooling

it depends on what you need. pgbouncer is the smallest and most
lightweight pooler available.

Also, Pgbouncer is the only connection-pooler that work on MS-Windows
that is released for production use.

I'm looking for a solution to split read and write access to different
servers (streaming replication, you know ...). Can i do that with
pgpool? (setting backend_weightX=0 or 1)? I have read the doc, but i'm
not sure if pgpool the right solution, maybe you can enlighten me?
(or someone else ...)

Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknown)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°

#5Filip Rembiałkowski
filip.rembialkowski@gmail.com
In reply to: Andreas Kretschmer (#4)
Re: How to use pgbouncer

2010/12/21 Andreas Kretschmer <akretschmer@spamfence.net>:

I'm looking for a solution to split read and write access to different
servers (streaming replication, you know ...). Can i do that with
pgpool? (setting backend_weightX=0 or 1)? I have read the doc, but i'm
not sure if pgpool the right solution, maybe you can enlighten me?
(or someone else ...)

did you see http://pgpool.projects.postgresql.org/pgpool-II/doc/pgpool-en.html#master_slave_mode
? I think it answers your question :-)

warning:
it works by detecting which queries are read-only, which does not
always work "out of the box".
you will sometimes have to modify driver settings or worse, modify SQL
queries including "hints" for pgpool.

see:
http://pgpool.projects.postgresql.org/pgpool-II/doc/pgpool-en.html#restriction
http://pgpool.projects.postgresql.org/pgpool-II/doc/pgpool-en.html#white_function_list
http://pgpool.projects.postgresql.org/pgpool-II/doc/pgpool-en.html#black_function_list

greets,
Filip

#6Andreas Kretschmer
akretschmer@spamfence.net
In reply to: Filip Rembiałkowski (#5)
Re: How to use pgbouncer

Filip Rembiałkowski <filip.rembialkowski@gmail.com> wrote:

2010/12/21 Andreas Kretschmer <akretschmer@spamfence.net>:

I'm looking for a solution to split read and write access to different
servers (streaming replication, you know ...). Can i do that with
pgpool? (setting backend_weightX=0 or 1)? I have read the doc, but i'm
not sure if pgpool the right solution, maybe you can enlighten me?
(or someone else ...)

did you see http://pgpool.projects.postgresql.org/pgpool-II/doc/pgpool-en.html#master_slave_mode
? I think it answers your question :-)

Now, yes ;-)

Thx.

warning:
it works by detecting which queries are read-only, which does not
always work "out of the box".
you will sometimes have to modify driver settings or worse, modify SQL
queries including "hints" for pgpool.

see:
http://pgpool.projects.postgresql.org/pgpool-II/doc/pgpool-en.html#restriction
http://pgpool.projects.postgresql.org/pgpool-II/doc/pgpool-en.html#white_function_list
http://pgpool.projects.postgresql.org/pgpool-II/doc/pgpool-en.html#black_function_list

Thank you.

Andreas
--
Really, I'm not out to destroy Microsoft. That will just be a completely
unintentional side effect. (Linus Torvalds)
"If I was god, I would recompile penguin with --enable-fly." (unknown)
Kaufbach, Saxony, Germany, Europe. N 51.05082°, E 13.56889°