Re: Sudden slow down and spike in system CPU causes max_connections to get exhausted - Mailing list pgsql-general

From John R Pierce
Subject Re: Sudden slow down and spike in system CPU causes max_connections to get exhausted
Date
Msg-id 52CB5A14.4070702@hogranch.com
Whole thread Raw
In response to Sudden slow down and spike in system CPU causes max_connections to get exhausted  ("Anand Kumar, Karthik" <Karthik.AnandKumar@classmates.com>)
List 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



pgsql-general by date:

Previous
From: "Anand Kumar, Karthik"
Date:
Subject: Sudden slow down and spike in system CPU causes max_connections to get exhausted
Next
From: Andy Colson
Date:
Subject: replicate per tablespace