Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 10C676329CA for ; Thu, 15 Apr 2010 14:38:17 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 09643-02 for ; Thu, 15 Apr 2010 17:38:06 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by mail.postgresql.org (Postfix) with ESMTP id 4B38E632474 for ; Thu, 15 Apr 2010 14:38:06 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id o3FHc06o004675; Thu, 15 Apr 2010 13:38:00 -0400 (EDT) To: Marinos Yannikos cc: pgsql-performance Subject: Re: 8.3.9 - latency spikes with Linux (and tuning for consistently low latency) In-reply-to: <4BC742C8.2050301@geizhals.at> References: <4BC742C8.2050301@geizhals.at> Comments: In-reply-to Marinos Yannikos message dated "Thu, 15 Apr 2010 18:46:00 +0200" Date: Thu, 15 Apr 2010 13:38:00 -0400 Message-ID: <4674.1271353080@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-0.011 tagged_above=-10 required=5 tests=BAYES_40=-0.001, T_RP_MATCHES_RCVD=-0.01 X-Spam-Level: X-Archive-Number: 201004/185 X-Sequence-Number: 38435 Marinos Yannikos 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