X-Original-To: pgsql-performance-postgresql.org@postgresql.org Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id 253339FB1F0 for ; Mon, 18 Sep 2006 11:37:40 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 94256-03 for ; Mon, 18 Sep 2006 14:37:34 +0000 (UTC) X-Greylist: delayed 00:06:38.833427 by SQLgrey- Received: from mail2.argia.fr (mail2.argia.fr [213.218.131.70]) by postgresql.org (Postfix) with SMTP id D0FE99FB1DB for ; Mon, 18 Sep 2006 11:37:33 -0300 (ADT) Received: (qmail 31991 invoked by uid 503); 18 Sep 2006 14:30:52 -0000 Received: from lewebquivabien.leroymerlin.fr (HELO ?10.16.134.247?) (195.25.212.55) by mail2.argia.fr with SMTP; 18 Sep 2006 14:30:52 -0000 Subject: Re: High CPU Load From: =?ISO-8859-1?Q?J=E9r=F4me?= BENOIS To: Guillaume Smet Cc: pgsql-performance@postgresql.org In-Reply-To: <1d4e0c10609141524j3532e140i308111908c1ab437@mail.gmail.com> References: <004001c6d80e$bdef5bc0$8300a8c0@tridecap.com> <1158249411.24726.17.camel@state.g2switchworks.com> <1158268058.5167.2.camel@localhost.localdomain> <1d4e0c10609141422o57ecf28eobf3d0b7594bb242f@mail.gmail.com> <1158270523.5167.18.camel@localhost.localdomain> <1d4e0c10609141524j3532e140i308111908c1ab437@mail.gmail.com> Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="=-Sne0QzihOK+vJP/dG0Ub" Date: Mon, 18 Sep 2006 16:30:51 +0200 Message-Id: <1158589852.5665.57.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.6.1 X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests= X-Spam-Level: X-Archive-Number: 200609/228 X-Sequence-Number: 20914 --=-Sne0QzihOK+vJP/dG0Ub Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Hi Guillaume, Now i disable Hyper Threading in BIOS, and "context switch storms" disappeared. (when i look with command sar -t) I decreased work_mem parameter to 32768. My CPU load is better. But it is still too high, in example :=20 top - 16:27:05 up 9:13, 3 users, load average: 45.37, 43.43, 41.43 Tasks: 390 total, 26 running, 363 sleeping, 0 stopped, 1 zombie Cpu(s): 89.5% us, 9.8% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.2% hi, 0.4% si Mem: 2076404k total, 2039552k used, 36852k free, 40412k buffers Swap: 1954312k total, 468k used, 1953844k free, 1232000k cached PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 30907 postgres 16 0 537m 51m 532m R 20.4 2.5 1:44.73 postmaster 25631 postgres 16 0 538m 165m 532m R 17.4 8.2 8:43.76 postmaster 29357 postgres 16 0 537m 311m 532m R 17.4 15.3 0:26.47 postmaster 32294 postgres 16 0 535m 86m 532m R 14.9 4.3 0:04.97 postmaster 31406 postgres 16 0 536m 180m 532m R 14.4 8.9 0:22.04 postmaster 31991 postgres 16 0 535m 73m 532m R 14.4 3.6 0:08.21 postmaster 30782 postgres 16 0 536m 205m 532m R 14.0 10.1 0:19.63 postmaster Tomorrow morning i plan to add 2Go RAM in order to test difference with my actual config. Have you another ideas ? Best Regards, --=20 J=C3=A9r=C3=B4me, python -c "print '@'.join(['.'.join([w[::-1] for w in p.split('.')]) for p in 'sioneb@gnireenigne-aigra.rf'.split('@')])" Le vendredi 15 septembre 2006 =C3=A0 00:24 +0200, Guillaume Smet a =C3=A9cr= it : > On 9/14/06, J=C3=A9r=C3=B4me BENOIS wrote: > > Yes i have a lot of users ;-) >=20 > So your work_mem is probably far too high (that's what I told you in > my first message) and you probably swap when you have too many users. > Remember that work_mem can be used several times per query (and it's > especially the case when you have a lot of sorts). > When your load is high, check your swap activity and your io/wait. top > gives you these information. If you swap, lower your work_mem to 32 MB > for example then see if it's enough for your queries to run fast (you > can check if there are files created in the $PGDATA/base/ database oid>/pg_tmp) and if it doesn't swap. Retry with a > lower/higher value to find the one that fits best to your queries and > load. >=20 > > I agree but by moment DB Server is so slow. >=20 > Yep, that's the information that was missing :). >=20 > > what's means "HT" please ? >=20 > Hyper threading. It's usually not recommended to enable it on > PostgreSQL servers. On most servers, you can disable it directly in > the BIOS. >=20 > -- > Guillaume >=20 > ---------------------------(end of broadcast)--------------------------- > TIP 1: if posting/reading through Usenet, please send an appropriate > subscribe-nomail command to majordomo@postgresql.org so that your > message can get through to the mailing list cleanly >=20 --=-Sne0QzihOK+vJP/dG0Ub Content-Type: application/pgp-signature; name=signature.asc Content-Description: Ceci est une partie de message =?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?= -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.2.2 (GNU/Linux) iD8DBQBFDq2bCDKlmlhpwnERAjmGAJ9jrDcjRXCvCQDKcD/xOHxTPzhYxgCcCUv4 IuKZuYTW7N0xDBA/zGWs2OY= =vf5y -----END PGP SIGNATURE----- --=-Sne0QzihOK+vJP/dG0Ub--