Managing backup speed with pg_basebackup

01.2015 / Category: / Tags: | |

pg_basebackup and backup speed: In the past couple of years, replication has been made easier and easier. Setting up streaming replication is pretty easy these days. When I train people I get a lot of positive feedback. People seem to like the way entire database instances can be cloned.

In many cases, DBAs use a straightforward approach to creating base backups: pg_basebackup.

Potential showstoppers on the way

While this is simple, there can be a small issue which pops up. What if the I/O capacity of two servers is low, while the network bandwidth is large? In case of a simple base backup, that can lead to high disk wait on both servers. The problem is that pg_basebackup running at full speed can easily cause response times to go up, because the disk is just too busy reading all the data.

Some customers have reported that this kind of problem even feels like downtime.

The solution to the problem is to control the speed of pg_basebackup. By reducing the backup speed to a reasonable level, the disk on the master has enough time to serve normal requests.

The -r flag of pg_basebackup can be used for exactly that:

Controlling the speed of your base backups can be a good idea if I/O bandwidth is an issue on your systems. It makes sure that your systems stay responsive all the time - even during a backup.


In order to receive regular updates on important changes in PostgreSQL, subscribe to our newsletter, or follow us on Twitter, Facebook, or LinkedIn.

0 0 votes
Article Rating
Notify of
1 Comment
Newest Most Voted
Inline Feedbacks
View all comments
9 years ago

excellent information to know 🙂

CYBERTEC Logo white
CYBERTEC PostgreSQL International GmbH
Römerstraße 19
2752 Wöllersdorf

+43 (0) 2622 93022-0

Get the newest PostgreSQL Info & Tools

    This site is protected by reCAPTCHA and the Google Privacy Policy & Terms of Service apply.

    CYBERTEC PostgreSQL International GmbH
    Would love your thoughts, please comment.x
    linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram