Re: Sudden slow down and spike in system CPU causes max_connections to get exhausted

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Sudden slow down and spike in system CPU causes max_connections to get exhausted
Date: 2014-01-07 01:36:20
Message-ID: 52CB5A14.4070702@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 1/6/2014 5:06 PM, Anand Kumar, Karthik wrote:
>
> We run postgres 9.1.11, on Centos 6.3, and an ext2 filesystem

please tell me thats a typo, and you're using ext4, or at least ext3.

> We do typically have a lot of idle connections (1500 connections
> total, over a 1000 idle at any given time). We're in the midst of
> installing pgbouncer to try and mitigate the problem, but that still
> doesn't address the root cause.
>

having 500 not-idle connections is disturbing. depending on the
complexities of those 500 active queries, you could be using 500 or 1000
or more times your work_mem setting in temporary buffers on top of your
other memory allocations. thats also going to use a LOT of file
handles in your kernel. and having 500 active queries competing for
your CPU cores, ouch.

I bet you're running out of memory during these busy peaks and going
very page-swap bound.

--
john r pierce 37N 122W
somewhere on the middle of the left coast

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Andy Colson 2014-01-07 02:22:23 replicate per tablespace
Previous Message Anand Kumar, Karthik 2014-01-07 01:06:40 Sudden slow down and spike in system CPU causes max_connections to get exhausted