Re: how could select id=xx so slow?

From: Yan Chunlu <springrider(at)gmail(dot)com>
To: Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>
Cc: Craig Ringer <ringerc(at)ringerc(dot)id(dot)au>, pgsql-performance(at)postgresql(dot)org
Subject: Re: how could select id=xx so slow?
Date: 2012-07-11 11:40:35
Message-ID: CAOA66tE9PwbQ07+g9=HhbVwqXosy=Tb=M51NwSpoAmh5LvnVnw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

could that because of my system is really busy?
1, postgresql always have 400+ connections(dozens of python process using
client pool)
2, the query peak is 50+/s
3, I do have some bad performance sql executing periodically, need 100+
second to complete. could those bad performance sql influence others?
because when I execute those simple sql directly, they was fast. but the
slow query log shows it took too much time.

On Wed, Jul 11, 2012 at 4:23 PM, Albe Laurenz <laurenz(dot)albe(at)wien(dot)gv(dot)at>wrote:

> Yan Chunlu wrote:
> > I have logged one day data and found the checkpoint is rather
> frequently(detail:
> > https://gist.github.com/3088338). Not sure if it is normal, but the
> average time of checkpoint is
> > about 100sec~200sec, it seems related with my settings:
> >
> > 574 checkpoint_segments = 64
> > 575 wal_keep_segments = 5000
> >
> > I set checkpoint_segments as a very large value which is because
> otherwise the slave server always can
> > not follow the master, should I lower that value?
>
> You mean, you set wal_keep_segments high for the standby, right?
>
> wal_keep_segments has no impact on checkpoint frequency and intensity.
>
> You are right that your checkpoint frequency is high. What is your value
> of checkpoint_timeout?
>
> You can increase the value of checkpoint_segments to decrease the
> checkpoint frequence, but recovery will take longer then.
>
> > or the slow query is about something else? thanks!
>
> I guess the question is how saturated the I/O system is during
> checkpoints. But even if it is very busy, I find it hard to believe
> that such a trivial statement can take extremely long.
>
> Yours,
> Laurenz Albe
>

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Andy Halsall 2012-07-11 11:46:23 query overhead
Previous Message Albe Laurenz 2012-07-11 08:23:07 Re: how could select id=xx so slow?