Thread: How to use pgbouncer

How to use pgbouncer

From
Adarsh Sharma
Date:
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

Re: How to use pgbouncer

From
Filip Rembiałkowski
Date:
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

Re: How to use pgbouncer

From
Richard Broersma
Date:
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.

Re: How to use pgbouncer

From
Andreas Kretschmer
Date:
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°

Re: How to use pgbouncer

From
Filip Rembiałkowski
Date:
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

Re: How to use pgbouncer

From
Andreas Kretschmer
Date:
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°