X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 347F79FB2F8 for ; Wed, 30 Aug 2006 12:08:19 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 39289-02 for ; Wed, 30 Aug 2006 12:08:09 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.206]) by postgresql.org (Postfix) with ESMTP id 48E339FB2F2 for ; Wed, 30 Aug 2006 12:08:09 -0300 (ADT) Received: by nz-out-0102.google.com with SMTP id 14so128764nzn for ; Wed, 30 Aug 2006 08:08:08 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=oVIELlgV+t45MJAtZj3B/W2YQXjDqTHL0o81B0cuslg1oxFNzfnrjReqVI71SdqIWa3Vcw5T6M5rZtS15qmsskZyXkvIeA2K1U5B1Jx5CChb0bsDWfXFvs/LODCgVgDc3t7CAtGB6OSSX55JLgBZRs4OrVJMgNS4Yl+vtEJhJbU= Received: by 10.64.184.14 with SMTP id h14mr810742qbf; Wed, 30 Aug 2006 08:08:07 -0700 (PDT) Received: by 10.65.137.12 with HTTP; Wed, 30 Aug 2006 08:08:07 -0700 (PDT) Message-ID: Date: Wed, 30 Aug 2006 11:08:07 -0400 From: "Merlin Moncure" To: "Willo van der Merwe" Subject: Re: PostgreSQL performance issues Cc: pgsql-performance@postgresql.org In-Reply-To: <44F56649.9050604@studentvillage.co.za> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <44F446B2.2090900@studentvillage.co.za> <44F56649.9050604@studentvillage.co.za> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.312 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, SPF_PASS X-Spam-Level: X-Archive-Number: 200608/479 X-Sequence-Number: 20664 On 8/30/06, Willo van der Merwe wrote: > This was just an example. All queries have slowed down. Could it be that > I've reached some cut-off and now my disk is thrashing? > > Currently the load looks like this: > Cpu0 : 96.8% us, 1.9% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 1.0% si > Cpu1 : 97.8% us, 1.6% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 0.3% si > Cpu2 : 96.8% us, 2.6% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 0.3% si > Cpu3 : 96.2% us, 3.2% sy, 0.0% ni, 0.3% id, 0.0% wa, 0.0% hi, 0.3% si > I don't think so, it looks like you are cpu bound. Your server has a (fairly high) budget of records per second it can crunch through. You have hit that limit and backpressure is building up and server load is escalating. This almost certainly due to inefficient sql, which is very easy to do especially if you are using some type of middleware which writes the sql for you. The trick here would be to turn all sql logging on and find out where your budget is getting spent. solving the problem may be a simple matter of adding an index or crafting a stored procedure. merlin