Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 33130632AA8 for ; Thu, 14 Jan 2010 10:29:19 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 13666-10 for ; Thu, 14 Jan 2010 14:29:08 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from mail-fx0-f227.google.com (mail-fx0-f227.google.com [209.85.220.227]) by mail.postgresql.org (Postfix) with ESMTP id 69F7C634215 for ; Thu, 14 Jan 2010 10:29:08 -0400 (AST) Received: by fxm27 with SMTP id 27so874720fxm.3 for ; Thu, 14 Jan 2010 06:29:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:received:date:from:to:subject :message-id:mime-version:content-type:content-disposition:user-agent; bh=O483tdeknSvC0Fbi6bHuXHNPaNV3QkiRzUU78IZlepw=; b=oBypZjwptI71ZJoF6d/pHDmR2vvgPOXkzewlCq4ey4Md8b3xglt5ADhqcY/ue56qvz kZrUCHFyK3Y4TLw5dQrQ76Ky031V0Xc6GbRGQLvT9IE+vosMEIxlZdh71IdyzNkwukHp m/6aum+URDboSJ4/dnm7VuDkTfvDR/keyI1O0= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:subject:message-id:mime-version:content-type :content-disposition:user-agent; b=ObKI95qehUbBBsU4QhJSHbqYsGzEVmPNqiz+2SYKlsOaAO3ApyHOgCZrqQBWI0ZjSu f7c8ibOVY6zHtVXtvSKlyMPQOYt0x08rbOeiQj8NmrZnHaA/wLPaPrMdzQeCswW2ramg GEWkqpCWqiBQiRxQEBGLfCFisCBpuYpdnJw8Q= Received: by 10.223.4.193 with SMTP id 1mr1128279fas.12.1263479345972; Thu, 14 Jan 2010 06:29:05 -0800 (PST) Received: from googlemail.com (p4FC1F002.dip.t-dialin.net [79.193.240.2]) by mx.google.com with ESMTPS id 14sm249238fxm.11.2010.01.14.06.29.04 (version=TLSv1/SSLv3 cipher=RC4-MD5); Thu, 14 Jan 2010 06:29:05 -0800 (PST) Received: by googlemail.com (nbSMTP-1.00) for uid 1100 (using TLSv1/SSLv3 with cipher RC4-MD5 (128/128 bits)) fkater@googlemail.com; Thu, 14 Jan 2010 15:29:04 +0100 (CET) Date: Thu, 14 Jan 2010 15:29:03 +0100 From: "fkater@googlemail.com" To: pgsql-performance@postgresql.org Subject: Inserting 8MB bytea: just 25% of disk perf used? Message-ID: <20100114142903.GB2973@comppasch2> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline User-Agent: Mutt/1.5.20 (2009-06-14) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.589 tagged_above=-10 required=5 tests=BAYES_00=-2.599, FH_DATE_PAST_20XX=3.188 X-Spam-Level: X-Archive-Number: 201001/272 X-Sequence-Number: 37152 Hello together, I need to increase the write performance when inserting bytea of 8MB. I am using 8.2.4 on windows with libpq. The test setting is simple: I write 100x times a byte array (bytea) of 8 MB random data into a table having a binary column (and oids and 3 other int columns, oids are indexed). I realized that writing 8 MB of 0-bytes is optimized away. With random data, the disk space now is filled with 800MB each run as expected. I use a transaction around the insert command. This takes about 50s, so, 800MB/50s = 16MB/s. However the harddisk (sata) could write 43 MB/s in the worst case! Why is write performance limited to 16 MB/s? Some more hints what I do: I use PQexecParams() and the INSERT ... $001 notation to NOT create a real escapted string from the data additionally but use a pointer to the 8MB data buffer. I altered the binary column to STORAGE EXTERNAL. Some experiments with postgresql.conf (fsync off, shared_buffers=1000MB, checkpoint_segments=256) did not change the 50s- much (somtimes 60s sometimes a little less). 4 Core CPU 3 Ghz, WinXP, 1 TB SATA disk. Do you have any further idea why 16MB/s seems to be the limit here? Thank You Felix