X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id 91336D1B557 for ; Fri, 13 Feb 2004 00:35:18 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 71644-05 for ; Thu, 12 Feb 2004 20:35:14 -0400 (AST) Received: from mail1.ihs.com (mail1.ihs.com [170.207.70.222]) by svr1.postgresql.org (Postfix) with ESMTP id 0EB23D1B4DE for ; Thu, 12 Feb 2004 20:35:10 -0400 (AST) Received: from css120.ihs.com (css120.ihs.com [170.207.105.120]) by mail1.ihs.com (8.12.10/8.12.10) with ESMTP id i1D0YGc5028942; Thu, 12 Feb 2004 17:34:16 -0700 (MST) Date: Thu, 12 Feb 2004 17:28:17 -0700 (MST) From: "scott.marlowe" To: Steve Crawford Cc: Greg Mennie , Subject: Re: hanging for 30sec when checkpointing In-Reply-To: <200402121457.59468.scrawford@pinpointresearch.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-IHS-MailScanner: Found to be clean X-IHS-MailScanner-SpamCheck: X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200402/193 X-Sequence-Number: 12367 On Thu, 12 Feb 2004, Steve Crawford wrote: > > > I'm running a reasonable sized (~30Gb) 7.3.4 database on Linux > > > and I'm getting some weird performance at times. > > > I am having a similar problem and this is what I've found so far: > > > > During the checkpoint the volume of data that's written isn't very > > high and it goes on for a fairly long time (up to 20 seconds) at a > > rate that appears to be well below our disk array's potential. The > > volume of data written is usually 1-5 MB/sec on an array that we've > > tested to sustain over 50 MB/sec (sequential writes, of course). > > > > It turns out that what's going on is that the command queue for the > > RAID array (3Ware RAID card) is filling up during the checkpoint > > and is staying at the max (254 commands) for most of the > > checkpoint. The odd lucky insert appears to work, but is extremely > > slow. In our case, the WAL files are on the same array as the data > > files, so everything grinds to a halt. > > I spoke with some 3Ware reps at a trade show and they recommended > adding the following to /etc/sysctl.conf: > vm.max-readahead = 256 > vm.min-readahead = 128 > > These settings take effect at boot. To change on a running system: > echo 256 > /proc/sys/vm/max-readahead > echo 128 > /proc/sys/vm/min-readahead Note that if you edit /etc/sysctl.conf and want the changes to take effect, you can do so with: sysctl -p