Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id 214669FB1D6 for ; Tue, 24 Oct 2006 17:11:02 -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 18063-09 for ; Tue, 24 Oct 2006 17:10:59 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from nz-out-0102.google.com (nz-out-0102.google.com [64.233.162.193]) by postgresql.org (Postfix) with ESMTP id E3AC19FB29E for ; Tue, 24 Oct 2006 17:10:58 -0300 (ADT) Received: by nz-out-0102.google.com with SMTP id i11so801283nzi for ; Tue, 24 Oct 2006 13:10:57 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=ijNPL7vlwh9UKwfe5d+9ezx2Tk+zm3Wl3k5L2C3PQPJ8+h3q0hXtA+aXFa5vQ3E9x1HCvlVnPpQhYGDKZIrcKg8Am2Y6mCZB8+VlNDrXoZotUi0CDJjglp6NZeNrfLQGyFzuWpX7fznmXwSOo/KSM8Whnq2Qdke0zVc4sLb/VGA= Received: by 10.35.78.13 with SMTP id f13mr6781035pyl; Mon, 23 Oct 2006 08:40:57 -0700 (PDT) Received: by 10.35.53.3 with HTTP; Mon, 23 Oct 2006 08:40:57 -0700 (PDT) Message-ID: Date: Mon, 23 Oct 2006 11:40:57 -0400 From: "Worky Workerson" To: "Markus Schaber" Subject: Re: Best COPY Performance Cc: pgsql-performance@postgresql.org In-Reply-To: <453C8B0D.4070803@logix-tt.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <453C8B0D.4070803@logix-tt.com> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.289 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE, SPF_PASS X-Spam-Level: X-Archive-Number: 200610/502 X-Sequence-Number: 21631 Markus, > Could you COPY one of your tables out to disk via psql, and then COPY it > back into the database, to reproduce this measurement with your real data? $ psql -c "COPY my_table TO STDOUT" > my_data $ ls my_data 2018792 edgescape_pg_load $ time cat my_data | psql -c "COPY mytable FROM STDIN" real 5m43.194s user 0m35.412s sys 0m9.567s > Also, how much is the disk load, and CPU usage? When I am loading via the perl (which I've established is a bottleneck), the one CPU core is at 99% for the perl and another is at 30% for a postmaster, vs about 90% for the postmaster when going through psql. The disk load is where I start to get a little fuzzy, as I haven't played with iostat to figure what is "normal". The local drives contain PG_DATA as well as all the log files, but there is a tablespace on the FibreChannel SAN that contains the destination table. The disk usage pattern that I see is that there is a ton of consistent activity on the local disk, with iostat reporting an average of 30K Blk_wrtn/s, which I assume is the log files. Every several seconds there is a massive burst of activity on the FC partition, to the tune of 250K Blk_wrtn/s. > On a table with no indices, triggers and contstraints, we managed to > COPY about 7-8 megabytes/second with psql over our 100 MBit network, so > here the network was the bottleneck. hmm, this makes me think that either my PG config is really lacking, or that the SAN is badly misconfigured, as I would expect it to outperform a 100Mb network. As it is, with a straight pipe to psql COPY, I'm only working with a little over 5.5 MB/s. Could this be due to the primary key index updates? Thanks!