Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?

От: Kenneth Marshall
Тема: Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?
Дата: ,
Msg-id: 20101223144628.GL10252@aart.is.rice.edu
(см: обсуждение, исходный текст)
Ответ на: Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?  (tuanhoanganh)
Список: pgsql-performance

Скрыть дерево обсуждения

PostgreSQL 9.0 x64 bit pgbench TPC very low question?  (tuanhoanganh, )
 Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?  (Jeff Janes, )
  Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?  (tuanhoanganh, )
   Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?  (Jeff Janes, )
  Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?  (tuanhoanganh, )
   Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?  (Ivan Voras, )
    Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?  (tuanhoanganh, )
     Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?  (Scott Marlowe, )
     Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?  (Scott Marlowe, )
      Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?  (tuanhoanganh, )
       Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?  (Scott Marlowe, )
        Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?  (Magnus Hagander, )
         Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?  (tuanhoanganh, )
          Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?  (Gurjeet Singh, )
           Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?  (tuanhoanganh, )
            Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?  ("Kevin Grittner", )
             Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?  (tuanhoanganh, )
              Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?  (Jeff Janes, )
            Re: PostgreSQL 9.0 x64 bit pgbench TPC very low question?  (Kenneth Marshall, )

On Thu, Dec 23, 2010 at 09:20:59PM +0700, tuanhoanganh wrote:
> Could you show me what parameter of pgbouncer.ini can do that. I read
> pgbouncer and can not make pgbouncer open and keep 200 connect to postgres
> (Sorry for my English)
>
> Thanks you very much.
>
> Tuan Hoang ANh
>

You need to use session pooling for that to work. From the man page:

       In order not to compromise transaction semantics for connection
       pooling, pgbouncer supports several types of pooling when
       rotating connections:

       Session pooling
           Most polite method. When client connects, a server connection
           will be assigned to it for the whole duration the client
           stays connected. When the client disconnects, the server
           connection will be put back into the pool. This is the
           default method.

       Transaction pooling
           A server connection is assigned to client only during a
           transaction. When PgBouncer notices that transaction is over,
           the server connection will be put back into the pool.

       Statement pooling
           Most aggressive method. The server connection will be put back
           into pool immediately after a query completes. Multi-statement
           transactions are disallowed in this mode as they would break.


The fact that pgbouncer will not keep 200 connections open to
the database means that you do not have enough work to actually
keep 200 permanent connections busy. It is much more efficient
to use transaction pooling. You typically want the number of
persistent database connections to be a small multiple of the
number of CPUs (cores) on your system. Then set pgbouncer to
allow as many client connections as you need. This will give
you the best throughput and pgbouncer can setup and tear down
the connections to your clients much, much faster than making
a full connection to the PostgreSQL database.

Regards,
Ken


В списке pgsql-performance по дате сообщения:

От: Ben
Дата:
Сообщение: encourging bitmap AND
От: Tom Lane
Дата:
Сообщение: Re: encourging bitmap AND