X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 028063A61AE for ; Tue, 7 Dec 2004 11:48:09 +0000 (GMT) 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 35625-07 for ; Tue, 7 Dec 2004 11:48:04 +0000 (GMT) Received: from fs3.ft.fo (mail-gw.ft.fo [212.55.40.2]) by svr1.postgresql.org (Postfix) with ESMTP id E101D3A6193 for ; Tue, 7 Dec 2004 11:48:05 +0000 (GMT) Received: from FT_DOM-MTA by fs3.ft.fo with Novell_GroupWise; Tue, 07 Dec 2004 11:48:02 +0000 Message-Id: X-Mailer: Novell GroupWise Internet Agent 6.5.1 Date: Tue, 07 Dec 2004 11:47:44 +0000 From: "John Jensen" To: Subject: Backup is too slow Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200412/56 X-Sequence-Number: 15642 Hi all, I'm a bit unhappy with the time it takes to do backup of my PG7.4.6 base. I have 13GB under the pg/data dir and it takes 30 minutes to do the backup. Using top and iostat I've figured out that the backup job is cpu bound in the postmaster process. It eats up 95% cpu while the disk is at 10% load. In fact I'm able to compress the backup file (using gzip) faster (35 % cpu load) than the backend can deliver it. The operating requirements is 24/7 so I can't just take the base offline and do a file copy. I can do backup that way in 5-6 minutes BTW. Would it speed up the process if I did a binary backup instead ? Are there any other fun tricks to speed up things ? I run on a four way Linux box and it's not in production yet so there is no cpu shortage. The backup script is: #! /bin/sh if test $# -lt 2; then echo "Usage: dbbackup " else /home/postgres/postgresql/bin/pg_dump -h $1 | gzip -f - | split --bytes 500m - $2. fi And the restore script: #! /bin/sh if test $# -lt 2; then echo "Usage: dbrestore " else cat $2.* | gzip -d -f - | /home/postgres/postgresql/bin/psql -h -f - $1 fi Cheers, John