Received: from maia.hub.org (maia-2.hub.org [200.46.204.251]) by mail.postgresql.org (Postfix) with ESMTP id 3FFA1673775 for ; Mon, 14 Nov 2011 19:06:29 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.251]) (amavisd-maia, port 10024) with ESMTP id 49015-05 for ; Mon, 14 Nov 2011 23:06:22 +0000 (UTC) X-Greylist: delayed 00:08:13.709677 by SQLgrey-1.8.0-rc2 Received: from makus.postgresql.org (makus.postgresql.org [98.129.198.125]) by mail.postgresql.org (Postfix) with ESMTP id 70065673773 for ; Mon, 14 Nov 2011 19:06:22 -0400 (AST) Received: from ns2.gransy.com ([89.187.132.100] helo=elizabeth.gransy.com) by makus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1RQ5Ta-0004ca-QA for pgsql-performance@postgresql.org; Mon, 14 Nov 2011 22:58:08 +0000 Received: from sq.gransy.com (localhost [127.0.0.1]) by elizabeth.gransy.com (Postfix) with ESMTP id E8E6915E4261; Mon, 14 Nov 2011 23:57:49 +0100 (CET) Received: from 78.45.133.255 (SquirrelMail authenticated user tv@fuzzy.cz) by sq.gransy.com with HTTP; Mon, 14 Nov 2011 23:57:49 +0100 Message-ID: In-Reply-To: References: <87e450fd65045c328f41e1b99a4029d5.squirrel@sq.gransy.com> Date: Mon, 14 Nov 2011 23:57:49 +0100 Subject: Re: Slow queries / commits, mis-configuration or hardware issues? From: "Tomas Vondra" To: "Cody Caughlan" Cc: "Tomas Vondra" , pgsql-performance@postgresql.org User-Agent: SquirrelMail/1.4.21 MIME-Version: 1.0 Content-Type: text/plain;charset=utf-8 X-Priority: 3 (Normal) Importance: Normal Content-Transfer-Encoding: quoted-printable X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201111/172 X-Sequence-Number: 45683 On 14 Listopad 2011, 22:58, Cody Caughlan wrote: >> Seems reasonable, although I'd bump up the checkpoint_timeout (the 5m = is >> usually too low). > > Ok, will do. Yes, but find out what that means and think about the possible impact first. It usually improves the checkpoint behaviour but increases the recovery time and you may need more checkpoint segments. And I doubt this will fix the issue you've described. > I ran bonnie++ on a slave node, doing active streaming replication but > otherwise idle: > http://batch-files-test.s3.amazonaws.com/sql03.prod.html > > bonnie++ on the master node: > http://batch-files-test.s3.amazonaws.com/sql01.prod.html > > If I am reading this right, this is my first time using it, the > numbers dont look too good. Are those instances equal, i.e. use tha same RAID10 config etc.? It surprises me a bit that the slave performs much better than the master, for example the sequential reads are much faster (210MB/s vs. 60MB/s) and it handles about twice the number of seeks (345 vs. 170). But this may be skewed because of the workload. > Heres a gist of running "iostat -x 3" for about a few minutes: > > https://gist.github.com/f94d98f2ef498a522ac2 > > Indeed, the %iowat and await values can spike up drastically. OK, so xvdb-xvde are individual drives and dm-0 is the RAID10 device, right? According to the log_checkpoint info, you're writing about 15000 (120MB) buffers in 270s, i.e. about 440kB/s. But according to the iostat you're writing up to 4MB/s, so it's not just about the checkpoints. What else is going on there? How much WAL do you write? Do you have iotop installed? That might give you a hint what processes ar= e writing data etc. I'm a bit confused that the w/s don't add up while r/s do. Tomas