Received: from localhost (unknown [200.46.208.211]) by mail.postgresql.org (Postfix) with ESMTP id 28D02632E6E for ; Tue, 17 Mar 2009 01:12:52 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.208.211]) (amavisd-maia, port 10024) with ESMTP id 65269-03 for ; Tue, 17 Mar 2009 01:12:48 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from westnet.com (westnet.com [216.187.52.2]) by mail.postgresql.org (Postfix) with ESMTP id EA12A632246 for ; Tue, 17 Mar 2009 01:12:47 -0300 (ADT) Received: from westnet.com (localhost [127.0.0.1]) by westnet.com (8.14.0/8.14.0) with ESMTP id n2H4CgAe006563; Tue, 17 Mar 2009 00:12:42 -0400 (EDT) Received: from localhost (gsmith@localhost) by westnet.com (8.14.0/8.13.2/Submit) with ESMTP id n2H4CgdB006560; Tue, 17 Mar 2009 00:12:42 -0400 (EDT) X-Authentication-Warning: westnet.com: gsmith owned process doing -bs Date: Tue, 17 Mar 2009 00:12:42 -0400 (EDT) From: Greg Smith X-X-Sender: gsmith@westnet.com To: Joe Uhl cc: pgsql-performance@postgresql.org Subject: Re: High CPU Utilization In-Reply-To: Message-ID: References: <8609D1C0-3ECD-4A4F-B9C6-1FC8496EDC7A@gmail.com> <200903161252.22202@hal.medialogik.com> <5F9840B1-D080-4F3A-81D4-57E8F1DB0955@gmail.com> User-Agent: Alpine 2.01 (GSO 1184 2008-12-16) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; format=flowed; charset=US-ASCII X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200903/225 X-Sequence-Number: 33147 On Mon, 16 Mar 2009, Joe Uhl wrote: > Now when I run vmtstat 1 30 it looks very different (below). That looks much better. Obviously you'd like some more headroom on the CPU situation than you're seeing, but that's way better than having so much time spent waiting for I/O. > max_connections = 1000 > work_mem = 30MB Be warned that you need to be careful with this combination. If all 1000 connections were to sort something at once, you could end up with >30GB worth of RAM used for that purpose. It's probably quite unlikely that will happen, but 30MB is on the high side with that many connections. I wonder if your pool might work better, in terms of lowering total CPU usage, if you reduced the number of incoming connections. Each connection adds some overhead and now that you've got the I/O situation under better control you might get by with less simultaneous ones. Something to consider. -- * Greg Smith gsmith@gregsmith.com http://www.gregsmith.com Baltimore, MD