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
.
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:
1 |
-r, --max-rate=RATE maximum transfer rate to transfer data directory |
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 Facebook or LinkedIn.
+43 (0) 2622 93022-0
office@cybertec.at
You are currently viewing a placeholder content from Facebook. To access the actual content, click the button below. Please note that doing so will share data with third-party providers.
More InformationYou are currently viewing a placeholder content from X. To access the actual content, click the button below. Please note that doing so will share data with third-party providers.
More Information
excellent information to know 🙂