Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 37B76B5DEEC for ; Tue, 1 Nov 2011 21:15:57 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 83832-01-10 for ; Wed, 2 Nov 2011 00:15:49 +0000 (UTC) Received: from mx2.hub.org (mx2.hub.org [200.46.204.254]) by mail.postgresql.org (Postfix) with ESMTP id 2DD2CB5DE98 for ; Tue, 1 Nov 2011 21:15:15 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.8.0-rc2 Received: from gw.wicourts.gov (gwmta.wicourts.gov [165.219.244.99]) by mx2.hub.org (Postfix) with ESMTP id 6534C17540A6 for ; Tue, 1 Nov 2011 18:10:17 -0300 (ADT) Received: from Courts-MTA by gw.wicourts.gov with Novell_GroupWise; Tue, 01 Nov 2011 14:47:46 -0500 Message-Id: <4EB0069002000025000428F9@gw.wicourts.gov> X-Mailer: Novell GroupWise Internet Agent 8.0.1 Date: Tue, 01 Nov 2011 14:47:44 -0500 From: "Kevin Grittner" To: "Brian Fehrle" Cc: "Kevin Kempter" , Subject: Re: background writer being lazy? References: <4EAF2F20.7080205@consistentstate.com> <4EAFC2CA02000025000428D2@gw.wicourts.gov> <4EB03821.6090408@consistentstate.com> <4EAFF7C502000025000428F2@gw.wicourts.gov> <4EB04533.4080905@consistentstate.com> In-Reply-To: <4EB04533.4080905@consistentstate.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline 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/4 X-Sequence-Number: 38598 Brian Fehrle wrote: > PostgreSQL 8.4.1 on x86_64-unknown-linux-gnu Please upgrade to the latest bug fix release of PostgreSQL: http://www.postgresql.org/support/versioning To see what bug and security fixes you're missing, look at release notes for 8.4.2 to 8.4.9 here: http://www.postgresql.org/docs/8.4/static/release.html There have been improvements in your areas of concern in 9.0 and 9.1, so you might want to start planning a major release upgrade. That's not as painful as it used to be, with pg_upgrade. > bgwriter_lru_maxpages | 500 FWIW, we do set this to 1000. > max_connections | 2000 This is probably your biggest problem. Unless you've got 1000 CPUs on this box, you should use a connection pooler which is transaction-oriented, limits the number of database connections, and queues requests for a new transaction when all connections are in use. This will almost certainly improve throughput and limit latency problems. You do not need 2000 connections to support 2000 cnocurrent users; such a setting will make it harder to provide 2000 concurrent users with decent and consistent performance. > effective_cache_size | 16GB Given your other settings, this seems likely to be low. I normally add the cache space reported by the OS to the shared_buffers setting. > shared_buffers | 16GB This is probably at least twice what it should be. If you are having problems with backends writing too many buffers and problems with clusters of I/O congestion, you might want to drop it to the 0.5 to 2.0 GB range. > wal_buffers | 8MB Might as well go to 16MB. > work_mem | 64MB Each of your connections can allocate this much space, potentially several times, at the same moment. Unless you really have a monster machine, 64MB * 2000 connections is just asking for out of memory failures at unpredictable peak load times. > One main thing is trying to lower 'spikey' disk IO so that > performance is more consistent at any given time. The advice above should help with that. -Kevin