X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id D29775372C for ; Wed, 20 Apr 2005 19:22:35 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 63815-07 for ; Wed, 20 Apr 2005 22:22:26 +0000 (GMT) Received: from flake.decibel.org (flake.decibel.org [67.100.216.10]) by svr1.postgresql.org (Postfix) with ESMTP id 75440535A2 for ; Wed, 20 Apr 2005 19:22:25 -0300 (ADT) Received: by flake.decibel.org (Postfix, from userid 1001) id 19A4515520; Wed, 20 Apr 2005 17:22:28 -0500 (CDT) Date: Wed, 20 Apr 2005 17:22:27 -0500 From: "Jim C. Nasby" To: Mischa Sandberg Cc: Tom Lane , pgsql-performance@postgresql.org Subject: Re: Slow copy with little CPU/disk usage Message-ID: <20050420222227.GW58835@decibel.org> References: <20050420020033.GZ58835@decibel.org> <19670.1113966354@sss.pgh.pa.us> <1113971840.4265dc810374c@webmail.telus.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1113971840.4265dc810374c@webmail.telus.net> X-Operating-System: FreeBSD 4.11-RELEASE i386 X-Distributed: Join the Effort! http://www.distributed.net User-Agent: Mutt/1.5.8i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.012 tagged_above=0 required=5 tests=AWL X-Spam-Level: X-Archive-Number: 200504/539 X-Sequence-Number: 11936 No, this is a single process. And there's known issues with context storms on Xeons, so that might be what you're seeing. On Tue, Apr 19, 2005 at 09:37:21PM -0700, Mischa Sandberg wrote: > Quoting Tom Lane : > > > "Jim C. Nasby" writes: > > > A friend of mine has an application where he's copying in 4000 rows at a > > > time into a table that has about 4M rows. Each row is 40-50 bytes. This > > > is taking 25 seconds on a dual PIII-1GHz with 1G of RAM and a 2 disk > > > SATA mirror, running FBSD 4.10-stable. There's one index on the table. > > > > If there's no hidden costs such as foreign key checks, that does seem > > pretty dang slow. > > > > > What's really odd is that neither the CPU or the disk are being > > > hammered. The box appears to be pretty idle; the postgresql proces is > > > using 4-5% CPU. > -- > This sounds EXACTLY like my problem, if you make the box to a Xeon 2.4GHz, 2GB > RAM ... with two SCSI drives (xlog and base); loading 10K rows of about 200 > bytes each; takes about 20 secs at the best, and much longer at the worst. By > any chance does your friend have several client machines/processes trying to > mass-load rows at the same time? Or at least some other processes updating > that table in a bulkish way? What I get is low diskio, low cpu, even low > context-switches ... and I'm betting he should take a look at pg_locks. For my > own problem, I gather that an exclusive lock is necessary while updating > indexes and heap, and the multiple processes doing the update can make that > pathological. > > Anyway, have your friend check pg_locks. > > > "Dreams come true, not free." -- S.Sondheim, ITW > -- Jim C. Nasby, Database Consultant decibel@decibel.org Give your computer some brain candy! www.distributed.net Team #1828 Windows: "Where do you want to go today?" Linux: "Where do you want to go tomorrow?" FreeBSD: "Are you guys coming, or what?"