From ef5856fd9b77ef9d0d0c31fb314bb61bbfb1d704 Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Thu, 27 Feb 2014 18:55:57 -0300 Subject: Allow BASE_BACKUP to be throttled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A new MAX_RATE option allows imposing a limit to the network transfer rate from the server side. This is useful to limit the stress that taking a base backup has on the server. pg_basebackup is now able to specify a value to the server, too. Author: Antonin Houska Patch reviewed by Stefan Radomski, Andres Freund, Zoltán Böszörményi, Fujii Masao, and Álvaro Herrera. --- doc/src/sgml/protocol.sgml | 18 ++++++++++++++++-- doc/src/sgml/ref/pg_basebackup.sgml | 21 +++++++++++++++++++++ 2 files changed, 37 insertions(+), 2 deletions(-) (limited to 'doc/src') diff --git a/doc/src/sgml/protocol.sgml b/doc/src/sgml/protocol.sgml index 832524e95e4..d36f2f3af1f 100644 --- a/doc/src/sgml/protocol.sgml +++ b/doc/src/sgml/protocol.sgml @@ -1772,7 +1772,7 @@ The commands accepted in walsender mode are: - BASE_BACKUP [LABEL 'label'] [PROGRESS] [FAST] [WAL] [NOWAIT] + BASE_BACKUP [LABEL 'label'] [PROGRESS] [FAST] [WAL] [NOWAIT] [MAX_RATE rate] Instructs the server to start streaming a base backup. @@ -1840,7 +1840,21 @@ The commands accepted in walsender mode are: the waiting and the warning, leaving the client responsible for ensuring the required log is available. - + + + + + MAX_RATE rate + + + Limit (throttle) the maximum amount of data transferred from server + to client per unit of time. The expected unit is kilobytes per second. + If this option is specified, the value must either be equal to zero + or it must fall within the range from 32 kB through 1 GB (inclusive). + If zero is passed or the option is not specified, no restriction is + imposed on the transfer. + + diff --git a/doc/src/sgml/ref/pg_basebackup.sgml b/doc/src/sgml/ref/pg_basebackup.sgml index 84b45ae7a00..ede68db9388 100644 --- a/doc/src/sgml/ref/pg_basebackup.sgml +++ b/doc/src/sgml/ref/pg_basebackup.sgml @@ -188,6 +188,27 @@ PostgreSQL documentation + + + + + + The maximum transfer rate of data transferred from 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. + + + The purpose is to limit the impact of pg_basebackup + on the running server. + + + This option always affects transfer of the data directory. Transfer of + WAL files is only affected if the collection method is fetch. + + + + -- cgit v1.2.3