Received: from localhost (wm.hub.org [200.46.204.128]) by postgresql.org (Postfix) with ESMTP id CCD529FB1BC for ; Tue, 24 Oct 2006 10:31:33 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.128]) (amavisd-new, port 10024) with ESMTP id 99270-03 for ; Tue, 24 Oct 2006 13:31:10 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey- Received: from brmea-mail-2.sun.com (brmea-mail-2.Sun.COM [192.18.98.43]) by postgresql.org (Postfix) with ESMTP id 2E0C39FB225 for ; Tue, 24 Oct 2006 10:31:10 -0300 (ADT) Received: from fe-amer-03.sun.com ([192.18.108.177]) by brmea-mail-2.sun.com (8.13.6+Sun/8.12.9) with ESMTP id k9ODV87F015498 for ; Tue, 24 Oct 2006 07:31:08 -0600 (MDT) Received: from conversion-daemon.mail-amer.sun.com by mail-amer.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) id <0J7N00E016FGEJ00@mail-amer.sun.com> (original mail from J.K.Shah@Sun.COM) for pgsql-performance@postgresql.org; Tue, 24 Oct 2006 07:31:08 -0600 (MDT) Received: from [129.150.116.141] by mail-amer.sun.com (Sun Java System Messaging Server 6.2-6.01 (built Apr 3 2006)) with ESMTPSA id <0J7N0040G6VUJMF0@mail-amer.sun.com>; Tue, 24 Oct 2006 07:31:08 -0600 (MDT) Date: Tue, 24 Oct 2006 14:31:10 +0100 From: Jignesh Shah Subject: Re: Copy database performance issue In-reply-to: To: Steve Cc: pgsql-performance@postgresql.org Message-id: <453E159E.4000203@sun.com> MIME-version: 1.0 Content-type: text/plain; format=flowed; charset=ISO-8859-15 Content-transfer-encoding: 7BIT References: User-Agent: Thunderbird 1.5.0.7 (Windows/20060909) X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.001 tagged_above=0 required=5 tests=UNPARSEABLE_RELAY X-Spam-Level: X-Archive-Number: 200610/500 X-Sequence-Number: 21629 Steve, Are you using the latest update release of Solaris 10 ? When you are doing the copy, did you check with prstat -amL to see if it is saturating on any CPU? If it is saturating on a CPU then atleast it will narrow down that you need to improve the CPU utilization of the copy process. Brendan Greg's "hotuser" script which uses DTrace and Pearl post processing will help you to figure out which functions is causing the high CPU utilization and then maybe somebody from the PostgreSQL team can figure out what's happening that is causing the slow copy. If none of the cores show up as near 100% then the next step is to figure out if any disk is 100% utilized via iostat -xczmP . With this information it might help to figure out the next steps in your case. Regards, Jignesh Steve wrote: > Hello there; > > I've got an application that has to copy an existing database to a new > database on the same machine. > > I used to do this with a pg_dump command piped to psql to perform the > copy; however the database is 18 gigs large on disk and this takes a > LONG time to do. > > So I read up, found some things in this list's archives, and learned > that I can use createdb --template=old_database_name to do the copy in > a much faster way since people are not accessing the database while > this copy happens. > > > The problem is, it's still too slow. My question is, is there any way > I can use 'cp' or something similar to copy the data, and THEN after > that's done modify the database system files/system tables to > recognize the copied database? > > For what it's worth, I've got fsync turned off, and I've read every > tuning thing out there and my settings there are probably pretty > good. It's a Solaris 10 machine (V440, 2 processor, 4 Ultra320 > drives, 8 gig ram) and here's some stats: > > shared_buffers = 300000 > work_mem = 102400 > maintenance_work_mem = 1024000 > > bgwriter_lru_maxpages=0 > bgwriter_lru_percent=0 > > fsync = off > wal_buffers = 128 > checkpoint_segments = 64 > > > Thank you! > > > Steve Conley > > ---------------------------(end of broadcast)--------------------------- > TIP 6: explain analyze is your friend