Re: Latency problems with simple queries

From: Jeff Davis <pgsql(at)j-davis(dot)com>
To: Adrian Schreyer <ams214(at)cam(dot)ac(dot)uk>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Latency problems with simple queries
Date: 2011-07-07 14:35:17
Message-ID: 1310049317.3012.153.camel@jdavis
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, 2011-07-07 at 12:13 +0100, Adrian Schreyer wrote:
> I randomly get latency/performance problems even with very simple
> queries, for example fetching a row by primary key from a small table.
> Since I could not trace it back to specific queries, I decided to give
> LatencyTOP (http://www.latencytop.org/) a go. Soon after running a
> couple of queries, I saw this in latencytop whilst a query was hanging
> in postgres:
>
> Cause Maximum Percentage
> Writing a page to disk 19283.9 msec 99.7

What IO scheduler and filesystem are you using?

I think that CFQ has some problems for database workloads. It would be
easy to test: just switch to deadline and/or noop for a while and see if
the problem persists.

Also, I have heard of a few strange things with ext4, but they have
probably fixed those issues and it would be much harder for you to test.
But it might be worth searching for issues/bugs with your particular
version of the filesystem.

Regards,
Jeff Davis

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Simon Riggs 2011-07-07 14:45:06 Re: Streaming replication on 9.1-beta2 after pg_restore is very slow
Previous Message salah jubeh 2011-07-07 14:21:59 Re: Oracle to Postgres migration open source tool