X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (neptune.hub.org [200.46.204.2]) by svr1.postgresql.org (Postfix) with ESMTP id BC659D1B477 for ; Thu, 4 Dec 2003 06:02:09 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (neptune.hub.org [200.46.204.2]) (amavisd-new, port 10024) with ESMTP id 74597-08 for ; Thu, 4 Dec 2003 02:01:39 -0400 (AST) Received: from luna.lyris.com (luna.lyris.com [216.91.57.116]) by svr1.postgresql.org (Postfix) with ESMTP id C3B31D1B8C4 for ; Thu, 4 Dec 2003 02:01:35 -0400 (AST) Received: from luna.lyris.com (luna.lyris.com [216.91.57.116]) by luna.lyris.com (8.12.8/8.12.8) with ESMTP id hB461ZIt012664 for ; Wed, 3 Dec 2003 22:01:35 -0800 Received: from luna.lyris.com ([216.91.57.116]) by luna.lyris.com (MailMonitor for SMTP v1.2.2 ) ; Wed, 3 Dec 2003 22:01:35 -0800 (PST) Received: from cletus.lyris.com (cletus.lyris.com [216.91.56.155]) by luna.lyris.net with SMTP (MailShield v2.04 - LINUX Jul 17 2001 16:58:31); Wed, 03 Dec 2003 22:01:35 -0800 Subject: tuning questions From: Jack Coates To: pgsql-admin Content-Type: text/plain Organization: Lyris Technologies, Inc. Message-Id: <1070517692.7638.40.camel@cletus.lyris.com> Mime-Version: 1.0 X-Mailer: Ximian Evolution 1.4.4-9mdk Date: Wed, 03 Dec 2003 22:01:33 -0800 Content-Transfer-Encoding: 7bit X-SMTP-HELO: cletus.lyris.com X-SMTP-MAIL-FROM: jack@lyris.com X-SMTP-RCPT-TO: pgsql-admin@postgresql.org X-SMTP-PEER-INFO: cletus.lyris.com [216.91.56.155] X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200312/25 X-Sequence-Number: 11533 Hi, I'm having trouble optimizing PostgreSQL for an admittedly heinous worst-case scenario load. testbed: dual P3 1.3 GHz box with 2GB RAM two IDE 120G drives on separate channels (DMA on), OS on one, DB on the other, some swap on each (totalling 2.8G). RH Linux 8. I've installed PG 7.3.4 from source (./configure && make && make install) and from PGDG RPMs and can switch back and forth. I also have the 7.4 source but haven't done any testing with it yet aside from starting it and importing some data. The application is on another server, and does this torture test: it builds a large table (~6 million rows in one test, ~18 million in another). Rows are then pulled in chunks of 4 to 6 thousand, acted on, and inserted back into another table (which will of course eventually grow to the full size of the first). The problem is that pulling the 4 to 6 thousand rows puts PostgreSQL into a tail spin: postmaster hammers on CPU anywhere from 90 seconds to five minutes before returning the data. During this time vmstat shows that disk activity is up of course, but it doesn't appear to be with page swapping (free and top and vmstat). Another problem is that performance of the 6 million row job is decent if I stop the job and run a vacuumdb --analyze before letting it continue; is this something that 7.4 will help with? vacuumb --analyze doesn't seem to have much effect on the 18 million row job. I've tweaked shared buffers to 8192, pushed sort memory to 2048, vacuum memory to 8192, and effective cache size to 10000. /proc/sys/kernel/shmmax is set to 1600000000 and /proc/sys/fs/file-max is set to 65536. Ulimit -n 3192. I've read several sites and postings on tuning PG and have tried a number of different theories, but I'm still not getting the architecture of how things work. thanks, -- Jack Coates, Lyris Technologies Applications Engineer 510-549-4350 x148, jack@lyris.com "Interoperability is the keyword, uniformity is a dead end." --Olivier Fourdan