如何提高pg_basebackup速度

问题描述 投票:0回答:1

如何提高pg_basebackup速度。我找不到 pg_basebackup 的并行选项。 pg_basebackup 没有任何并行选项吗?谢谢。我只是想快速创建从数据库。数据库大小为5TB,创建Slave数据库需要更多时间。如果没有任何并行选项我怎样才能避免这个时间问题?

创建Slave的命令

pg_basebackup -Xs -h 172.31.34.215 -U repuser --checkpoint=fast -D /var/lib/postgresql/14/ter -R --slot=replication_slot -C

postgresql
1个回答
0
投票

虽然pg_basebackup没有可用的并行进程。但是您可以添加一个传输速率参数,以该参数从源服务器收集数据。您可以在 PostGres 文档中找到更多详细信息。这里我分享一下参数详情:

-r 率 --最大速率=速率

"Sets the maximum transfer rate at which data is collected from the source server. This can be useful to limit the impact of pg_basebackup on the server. Values are in kilobytes per second. Use a suffix of M to indicate megabytes per second. A suffix of k is also accepted and has no effect. Valid values are between 32 kilobytes per second and 1024 megabytes per second." 
© www.soinside.com 2019 - 2024. All rights reserved.