Re: postgresql.conf recommendations

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Johnny Tan <johnnydtan(at)gmail(dot)com>
Cc: pgsql-performance(at)postgresql(dot)org, Alex Kahn <alex(at)paperlesspost(dot)com>
Subject: Re: postgresql.conf recommendations
Date: 2013-02-06 20:12:42
Message-ID: CAMkU=1wQSW2YpJEf1tg2qHvRr3xVahJK2rh-SebfuBu=tbQSTw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

On Tue, Feb 5, 2013 at 2:02 PM, Johnny Tan <johnnydtan(at)gmail(dot)com> wrote:

> checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0

I always set this to 0.9. I don't know why the default is 0.5.

> But periodically, there are spikes in our app's db response time. Normally,
> the app's db response time hovers in the 100ms range for most of the day.
> During the spike times, it can go up to 1000ms or 1500ms, and the number of
> pg connections goes to 140 (maxed out to pgbouncer's limit, where normally
> it's only about 20-40 connections).

What if you lower the pgbouncer limit to 40?

It is hard to know if the latency spikes cause the connection build
up, or if the connection build up cause the latency spikes, or if they
reinforce each other in a vicious circle. But making the connections
wait in pgbouncer's queue rather than in the server should do no harm,
and very well might help.

> Also, during these times, which usually
> last less than 2 minutes, we will see several thousand queries in the pg log
> (this is with log_min_duration_statement = 500), compared to maybe one or
> two dozen 500ms+ queries in non-spike times.

Is the nature of the queries the same, just the duration that changes?
Or are the queries of a different nature?

Cheers,

Jeff

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Josh Krupka 2013-02-06 20:27:46 Re: postgresql.conf recommendations
Previous Message Johnny Tan 2013-02-06 19:47:54 Re: postgresql.conf recommendations