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 F04429FA2E6 for ; Thu, 14 Sep 2006 11:17:42 -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 45379-03 for ; Thu, 14 Sep 2006 11:17:22 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from exchange.g2switchworks.com (mail.g2switchworks.com [63.87.162.25]) by postgresql.org (Postfix) with ESMTP id 63E299F9F2F for ; Thu, 14 Sep 2006 11:17:31 -0300 (ADT) Received: from 10.10.1.37 ([10.10.1.37]) by exchange.g2switchworks.com ([10.10.1.2]) with Microsoft Exchange Server HTTP-DAV ; Thu, 14 Sep 2006 14:17:25 +0000 Received: from state.g2switchworks.com by mail.g2switchworks.com; 14 Sep 2006 09:17:24 -0500 Subject: Re: High CPU Load From: Scott Marlowe To: =?ISO-8859-1?Q?J=E9r=F4me?= BENOIS Cc: Guillaume Smet , pgsql-performance@postgresql.org In-Reply-To: <1158242414.5226.31.camel@localhost.localdomain> References: <1158239339.5226.17.camel@localhost.localdomain> <1d4e0c10609140646g6ad1ab4w51dec49afba11fd7@mail.gmail.com> <1158242414.5226.31.camel@localhost.localdomain> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Message-Id: <1158243444.24726.10.camel@state.g2switchworks.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.6 (1.4.6-2) Date: Thu, 14 Sep 2006 09:17:24 -0500 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.09 tagged_above=0 required=5 tests=AWL, SPF_PASS, UNPARSEABLE_RELAY X-Spam-Level: X-Archive-Number: 200609/153 X-Sequence-Number: 20839 On Thu, 2006-09-14 at 09:00, J=C3=A9r=C3=B4me BENOIS wrote: > Hi Guillaume, >=20 > Le jeudi 14 septembre 2006 =C3=A0 15:46 +0200, Guillaume Smet a =C3=A9cri= t : > > On 9/14/06, J=C3=A9r=C3=B4me BENOIS wrote= : > > > I migrated Postgres server from 7.4.6 to 8.1.4, But my server is > > > completely full, by moment load average > 40 > > > All queries analyzed by EXPLAIN, all indexes are used .. IO i= s good ... > >=20 > > What is the bottleneck? Are you CPU bound? Do you have iowait? Do you > > swap? Any weird things in vmstat output? > the load average goes up and goes down between 1 and 70, it's strange. > IO wait and swap are good. I have just very high CPU load. And it's user > land time. >=20 > top output :=20 >=20 > top - 15:57:57 up 118 days, 9:04, 4 users, load average: 8.16, 9.16, > 15.51 > Tasks: 439 total, 7 running, 432 sleeping, 0 stopped, 0 zombie > Cpu(s): 87.3% us, 6.8% sy, 0.0% ni, 4.8% id, 0.1% wa, 0.2% hi, > 0.8% si > Mem: 2076404k total, 2067812k used, 8592k free, 13304k buffers > Swap: 1954312k total, 236k used, 1954076k free, 1190296k cached >=20 > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND > 15667 postgres 25 0 536m 222m 532m R 98.8 11.0 1:39.29 postmaster > 19533 postgres 25 0 535m 169m 532m R 92.9 8.3 0:38.68 postmaster > 16278 postgres 25 0 537m 285m 532m R 86.3 14.1 1:37.56 postmaster > 18695 postgres 16 0 535m 171m 532m S 16.1 8.5 0:14.46 postmaster > 18092 postgres 16 0 544m 195m 532m R 11.5 9.7 0:31.87 postmaster > 16896 postgres 15 0 534m 215m 532m S 6.3 10.6 0:27.13 postmaster Somewhere, the query planner is likely making a really bad decision. Have you analyzed your dbs?