Received: from localhost (unknown [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 9D9C59F9B13 for ; Wed, 19 Sep 2007 14:53:45 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 85272-02 for ; Wed, 19 Sep 2007 14:53:39 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from mail01.enterprisedb.com (mail01.enterprisedb.com [63.246.7.168]) by postgresql.org (Postfix) with ESMTP id 643349F9AB7 for ; Wed, 19 Sep 2007 14:53:41 -0300 (ADT) thread-index: Acf65gxV5+ojLSRhRtWMqXAJ0pRfvw== Received: from [192.168.1.33] ([82.3.228.35]) by mail01.enterprisedb.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Wed, 19 Sep 2007 13:53:53 -0400 Message-ID: <46F161F3.1070601@enterprisedb.com> Content-Class: urn:content-classes:message Date: Wed, 19 Sep 2007 18:52:51 +0100 Importance: normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.4073 From: "Heikki Linnakangas" User-Agent: Icedove 1.5.0.12 (X11/20070730) MIME-Version: 1.0 To: Cc: Subject: Re: Low CPU Usage References: <65712.86940.qm@web30004.mail.mud.yahoo.com> In-Reply-To: <65712.86940.qm@web30004.mail.mud.yahoo.com> Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit X-OriginalArrivalTime: 19 Sep 2007 17:53:53.0687 (UTC) FILETIME=[0AF92270:01C7FAE6] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200709/319 X-Sequence-Number: 26864 brauagustin-susc@yahoo.com.ar wrote: > Recently I have installed a brand new server with a Pentium IV 3.2 GHz, SATA Disk, 2GB of Ram in Debian 4.0r1 with PostgreSQL 8.2.4 (previously a 8.1.9). > I have other similar server with an IDE disk, Red Hat EL 4 and PostgreSQL 8.2.3 > > I have almost the same postgresql.conf in both servers, but in the new one (I have more work_mem than the other one) things go really slow. I began to monitor i/o disk and it's really ok, I have test disk with hdparm and it's 5 times faster than the IDE one. > Running the same queries in both servers in the new one it envolves almost 4 minutes instead of 18 seconds in the old one. > Both databases are the same, I have vacuum them and I don't know how to manage this issue. Have you ANALYZEd all tables? Try running EXPLAIN ANALYZE on the query on both servers, and see if they're using the same plan. > The only weird thing is than in the older server running the query it uses 30% of CPU instead of 3 o 5 % of the new one!!! That implies that it's doing much more I/O on the new server, so the CPU just sits and waits for data to arrive from the disk. That does iostat say about disk utilization on both servers? -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com