Re: Increase in max_connections

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: "Anand Kumar, Karthik" <Karthik(dot)AnandKumar(at)classmates(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Increase in max_connections
Date: 2014-03-11 16:23:02
Message-ID: CAMkU=1zPHKRQ7S1=_WCa52dQSSD+PUOGtr+Mo3hTv1BaQAJqPg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Mar 10, 2014 at 6:04 PM, Anand Kumar, Karthik <
Karthik(dot)AnandKumar(at)classmates(dot)com> wrote:

> Hi all,
>
> We're running postgres 9.3.2, server configuration below.
>
> Seemingly randomly, we will see the number of active queries in postgres
> go up until we hit max_connections. The DB will recover after a few minutes.
>
> We had the issue a couple of times in Feb 2014. We then upgraded the
> postgres server from 9.1 to 9.3.2, and the occurrence has gone up
> significantly - to several times a day.
>
> The user CPU goes up as well to a 100%, no increase in I/O or system CPU.
> We have slow query logging, and there is no dramatic change in the slow
> queries either.
>

I think you might need to change your cutoff for what makes a slow query.
It must be the case that either your are seeing an abnormal spike in query
requests, or that the queries are taking an abnormally long time (or both).
If not many queries are hitting log_min_duration_statement, that just
means you can lower it further without causing too much log bloat.

Usually when people hit max_connections under load, it means they need to
move the limit into a connection pooler (where it can be more graceful, by
putting them in a queue for a free slot, rather than returning an error)
and *lower* max_connections.

max_connections|1500|configuration file
>

That is very high.

Cheers,

Jeff

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Anand Kumar, Karthik 2014-03-11 17:10:15 Re: Increase in max_connections
Previous Message David Welton 2014-03-11 15:25:47 named queries and the wire protocol