Re: 8.3.9 - latency spikes with Linux (and tuning for consistently low latency)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Marinos Yannikos <mjy(at)geizhals(dot)at>
Cc: pgsql-performance <pgsql-performance(at)postgresql(dot)org>
Subject: Re: 8.3.9 - latency spikes with Linux (and tuning for consistently low latency)
Date: 2010-04-15 17:38:00
Message-ID: 4674.1271353080@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Marinos Yannikos <mjy(at)geizhals(dot)at> writes:
> we are seeing latency spikes in the 2-3 second range (sometimes 8-10s) for
> queries that usually take 3-4ms on our systems and I am running out of things to
> try to get rid of them.

Have you checked whether the spikes correlate with checkpoints? Turn
on log_checkpoints and watch for awhile. If so, fooling with the
checkpoint parameters might give some relief. However, 8.3 already has
the spread-checkpoint code so I'm not sure how much more win can be had
there.

More generally, you should watch vmstat/iostat output and see if you
can correlate the spikes with I/O activity, CPU peaks, etc.

A different line of thought is that maybe the delays have to do with lock
contention --- log_lock_waits might help you identify that.

> fsync=off

That's pretty scary.

> work_mem=500MB

Yipes. I don't think you have enough RAM for that to be safe.

> commit_delay=100000 (*)

This is probably not a good idea.

> autovacuum=off (*)

Nor this.

regards, tom lane

In response to

Responses

Browse pgsql-performance by date

  From Date Subject
Next Message Kevin Grittner 2010-04-15 17:47:26 Re: 8.3.9 - latency spikes with Linux (and tuning for consistently low latency)
Previous Message Marinos Yannikos 2010-04-15 16:46:00 8.3.9 - latency spikes with Linux (and tuning for consistently low latency)