Skip site navigation (1) Skip section navigation (2)

Re: Queries sometimes take 1000 times the normal time

From: "Anders K(dot) Pedersen" <akp(at)cohaesio(dot)com>
To: pgsql-performance(at)postgresql(dot)org
Subject: Re: Queries sometimes take 1000 times the normal time
Date: 2003-08-28 18:23:46
Message-ID: bilhbi$9rg$ (view raw, whole thread or download thread mbox)
Lists: pgsql-performance
Tom Lane wrote:
> "Anders K. Pedersen" <akp(at)cohaesio(dot)com> writes:
>>Currently there's only a few users in the database for testing purposes, 
>>and most of the time the user lookup's take 2-3 ms (I have syslog'ing of 
>>queries and duration turned on), but several times per hour the duration 
>>for one of the queries is 2-3 seconds (1000 times larger), while the 
>>surrounding lookups take the usual 2-3 ms.
> One thing that comes to mind is that the slow query could be occurring
> at the same time as a checkpoint, or some other cycle-chewing background
> operation.  It's not clear why a checkpoint would slow things down that
> much, though.  Anyway I'd suggest looking for such activities; once we
> know if that's the issue or not, we can make some progress.

One of my colleagues suggested looking for checkpoints as well; I 
searched the log, but only the following messages turned up:

Aug 11 15:21:04 gs1 postgres[5447]: [2] LOG:  checkpoint record is at 
Aug 23 13:59:51 gs1 postgres[16451]: [2] LOG:  checkpoint record is at 
Aug 25 02:48:17 gs1 postgres[1059]: [2] LOG:  checkpoint record is at 

Currently there are only relatively few changes to the database - one 
INSERT everytime one of our game admins executes an administrative 
command (like ban or kick), and this happens at most 10 times per hour. 
As I understand checkpoints, this should mean, that they aren't 
happening very often, and when they do, should be able to finish almost 

Anders K. Pedersen

In response to

pgsql-performance by date

Next:From: Rod TaylorDate: 2003-08-28 18:29:02
Subject: Re: Hardware recommendations to scale to silly load
Previous:From: Al HulatonDate: 2003-08-28 18:17:16
Subject: Re: The results of my PostgreSQL/filesystem performance tests

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group