Received: from maia.hub.org (maia-5.hub.org [200.46.204.29]) by mail.postgresql.org (Postfix) with ESMTP id 949C2B5DBE6 for ; Thu, 4 Aug 2011 10:50:07 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.29]) (amavisd-maia, port 10024) with ESMTP id 07761-03 for ; Thu, 4 Aug 2011 13:50:01 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from mail-iy0-f172.google.com (mail-iy0-f172.google.com [209.85.210.172]) by mail.postgresql.org (Postfix) with ESMTP id 630DAB5DBCA for ; Thu, 4 Aug 2011 10:49:59 -0300 (ADT) Received: by iye7 with SMTP id 7so260609iye.17 for ; Thu, 04 Aug 2011 06:49:59 -0700 (PDT) Received: by 10.231.48.195 with SMTP id s3mr626351ibf.168.1312465799685; Thu, 04 Aug 2011 06:49:59 -0700 (PDT) Received: from [10.1.1.8] (124-169-181-228.dyn.iinet.net.au [124.169.181.228]) by mx.google.com with ESMTPS id z18sm1272496ibf.1.2011.08.04.06.49.57 (version=SSLv3 cipher=OTHER); Thu, 04 Aug 2011 06:49:59 -0700 (PDT) Message-ID: <4E3AA382.9050302@ringerc.id.au> Date: Thu, 04 Aug 2011 21:49:54 +0800 From: Craig Ringer User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:5.0) Gecko/20110624 Thunderbird/5.0 MIME-Version: 1.0 To: Adarsh Sharma CC: pgsql-performance@postgresql.org Subject: Re: Need to tune for Heavy Write References: <4E3A268C.9090409@orkash.com> In-Reply-To: <4E3A268C.9090409@orkash.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=-1.9 tagged_above=-10 required=5 tests=BAYES_00=-1.9 X-Spam-Level: X-Archive-Number: 201108/52 X-Sequence-Number: 44499 On 4/08/2011 12:56 PM, Adarsh Sharma wrote: > Dear all, > > From the last few days, I researched a lot on Postgresql Performance > Tuning due to slow speed of my server. > My application selects data from mysql database about 100000 rows , > process it & insert into postgres 2 tables by making about 45 connections. Why 45? Depending on your disk subsystem, that may be way too many for optimum throughput. Or too few, for that matter. Also, how are you doing your inserts? Are they being done in a single big transaction per connection, or at least in resonable chunks? If you're doing stand-alone INSERTs autocommit-style you'll see pretty shoddy performance. Have you looked into using COPY to bulk load your data? Possibly using the libpq or jdbc copy APIs, or possibly using server-side COPY? > fsync=off full_page_writes=off synchronous_commit=off !!!! I hope you don't want to KEEP that data if you have a hardware fault or power loss. Setting fsync=off is pretty much saying "I don't mind if you eat my data". Keep. Really. Really. Good. Backups. -- Craig Ringer