Re: pg_base_backup limit bandwidth possible?

Поиск
Список
Период
Сортировка
От Matthew Kelly
Тема Re: pg_base_backup limit bandwidth possible?
Дата
Msg-id 644C7380-A114-4DAE-9E8F-E5A26A59E505@tripadvisor.com
обсуждение исходный текст
Ответ на Re: pg_base_backup limit bandwidth possible?  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: pg_base_backup limit bandwidth possible?  (Edson Carlos Ericksson Richter <edsonrichter@hotmail.com>)
Список pgsql-general
The way I’ve solved the problem before 9.4 is to use a command called 'pv' (pipe view).  Normally this command is useful for seeing the rate of data flow in a pipe, but it also does have a rate limiting capacity.  The trick for me was running the output of pg_basebackup through pv (emulates having a slow disk) without having to have double the storage when building a new slave.

First, 'pg_basebackup' to standard out in the tar format.  Then pipe that to 'pv' to quietly do rate limiting.  Then pipe that to 'tar' to lay it out in a directory format.  Tar will dump everything into the current directory, but transform will give you the effect of having selected a directory in the initial command.

The finished product looks something like:
pg_basebackup -U postgres -D - -F t -x -vP | pv -q --rate-limit 100m | tar -xf - --transform='s`^`./pgsql-data-backup/`'



В списке pgsql-general по дате отправления:

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: partial "on-delete set null" constraint
Следующее
От: Rafal Pietrak
Дата:
Сообщение: Re: partial "on-delete set null" constraint