From: John Jensen <JRJ@ft.fo>
To: pgsql-admin@postgresql.org
Subject: Backup is too slow
Date: Tue, 07 Dec 2004 11:47:44 +0000
Message-ID: <s1b59872.066@fs3.ft.fo> (raw)
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 <basename> <filename>"
else
/home/postgres/postgresql/bin/pg_dump -h <hostname> $1 | gzip -f - |
split --bytes 500m - $2.
fi
And the restore script:
#! /bin/sh
if test $# -lt 2; then
echo "Usage: dbrestore <basename> <filename>"
else
cat $2.* | gzip -d -f - | /home/postgres/postgresql/bin/psql -h
<hostname> -f - $1
fi
Cheers,
John
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: JRJ@ft.fo
Subject: Re: Backup is too slow
In-Reply-To: <s1b59872.066@fs3.ft.fo>
References: <s1b59872.066@fs3.ft.fo>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox