Re: Too much clients connected to the PostgreSQL Database

From: Xiong He <iihero(at)qq(dot)com>
To: rodrigo <rodrigo(at)paripassu(dot)com(dot)br>, Kevin Grittner <kgrittn(at)mail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Too much clients connected to the PostgreSQL Database
Date: 2012-10-30 01:42:34
Message-ID: tencent_0A96ED7B382DA51E3E04B096@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

If you are using connection pool, did you use pgbouncer to reduce the maximum physical connection?
You said, "but we have some low usage application getting direct db connection(out of the pool)." It will mean that some connections are not controlled by the connection pool. This can be variable in the real environment.

------------------
Thanks&Regards,
Xiong He

------------------ Original ------------------
From: "rodrigo"<rodrigo(at)paripassu(dot)com(dot)br>;
Date: Tue, Oct 30, 2012 09:06 AM
To: "Kevin Grittner"<kgrittn(at)mail(dot)com>;
Cc: "pgsql-general"<pgsql-general(at)postgresql(dot)org>;
Subject: Re: [GENERAL] Too much clients connected to the PostgreSQL Database

150 maxActive setting, but we have some low usage application getting direct db
connection(out of the pool).

The interesting is that the server suddently get a lot of connections and reach the
limit and then release them.

I'm willing to change to Tomcat 7 connection pool. We are using c3pO and apache ones,
maybe that's a problem.

Thank you,

Well,

> Rodrigo Pereira da Silva wrote:
>
>> We have about 10 web applications deployed in a Tomcat 7.0
>> accessing a Postgresql 9.1 database. We do use connection pooling.
>> We have the max_connections parameter set to 200 connections,
>> however, we are reaching the max connections sporadically(about 4
>> time/day).
>
> What is the pooler's maxActive setting? (It should be less than the
> PostgreSQL max_connections setting.)
>
> BTW, 200 seems alwfully high unless a *really* high end machine. You
> may have fewer timeouts if you avoid swamping the server with a
> "thundering herd" of requests.
>
> http://wiki.postgresql.org/wiki/Number_Of_Database_Connections
>
> -Kevin
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>

--
Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Browse pgsql-general by date

  From Date Subject
Next Message Craig Ringer 2012-10-30 02:10:09 Re: Access to postgresql query optimizer output
Previous Message rodrigo 2012-10-30 01:06:04 Re: Too much clients connected to the PostgreSQL Database