Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id B61D22E377D for ; Wed, 23 Jan 2008 20:59:10 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 02008-02-8 for ; Wed, 23 Jan 2008 20:58:59 -0400 (AST) Received: from westnet.com (westnet.com [216.187.52.2]) by postgresql.org (Postfix) with ESMTP id 8B6642E3091 for ; Wed, 23 Jan 2008 20:31:54 -0400 (AST) Received: from westnet.com (localhost [127.0.0.1]) by westnet.com (8.14.0/8.14.0) with ESMTP id m0O0Vp3X015118; Wed, 23 Jan 2008 19:31:51 -0500 (EST) Received: from localhost (gsmith@localhost) by westnet.com (8.14.0/8.13.2/Submit) with ESMTP id m0O0Vp1b015114; Wed, 23 Jan 2008 19:31:51 -0500 (EST) X-Authentication-Warning: westnet.com: gsmith owned process doing -bs Date: Wed, 23 Jan 2008 19:31:51 -0500 (EST) From: Greg Smith X-X-Sender: gsmith@westnet.com To: Tory M Blue cc: pgsql-performance@postgresql.org Subject: Re: Postgres 8.2 memory weirdness In-Reply-To: <8a547c840801231023q55796128nb2e88b8c8cfe86e@mail.gmail.com> Message-ID: References: <8a547c840801231023q55796128nb2e88b8c8cfe86e@mail.gmail.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200801/206 X-Sequence-Number: 28445 On Wed, 23 Jan 2008, Tory M Blue wrote: > I have hundreds of thousands of updates, inserts a day. But what I'm > seeing is my server appears to "deallocate" memory (for the lack of a > better term) and performance goes to heck, slow response, a sub second > query takes anywhere from 6-40 seconds to complete when this happens. Generally if you have a system doing many updates and inserts that slows for that long, it's because it hit a checkpoint. I'm not sure what your memory-related issues are but it's possible that might be from a backlog of sessions using memory that are stuck behind the checkpoint, particularly since you mention simple query connections stacking up during these periods. In any case you should prove/disprove this is checkpoint-related behavior before you chase down something more esoteric. There's a quick intro to this area in the "Monitoring checkpoints" section of http://www.westnet.com/~gsmith/content/postgresql/chkp-bgw-83.htm and the later sections go into what you can do about it. > I suspect I've outgrown our initial postgres config, or there are more > sysctl or other kernel tweaks that need to happen. You should post a list of what you're changed from the defaults. You're analyzing from the perspective where you assume it's a memory problem and a look at your config will give a better idea whether that's possible or not. Other good things to mention: exact 8.2 version, OS, total memory, outline of disk configuration. -- * Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD