I have a master PostgreSQL 9.5 server and a standby server. For replication I use repmgr
(WAL streaming). Typically the delay between master and standby is <5s:
$ psql -t -c "SELECT extract(epoch from now() - pg_last_xact_replay_timestamp());"
0.044554
Periodically pg_repack
is invoked on master in order to optimize indexes and tables. Repacking tables causes massive changes in WAL streaming and significantly slows down replication, so that the difference between master and standby could be more than 1h.
Is there a way how to reduce such delay? Is it possible to synchronize newly incoming data with higher priority than repack changes?