On Wed, 2020-11-18 at 12:15 +0000, Alexey Bashtanov wrote: > My reply did not get threaded appropriately. > My original question was here: > https://www.postgresql.org/message-id/a74d5732-60fd-d18b-05fd-7b2b97099f19%40imap.cc > I'd like to prioritize walsender for replication not to lag too much. > Otherwise, when I have load spikes on master, standby lags, sometimes by > hundreds of gigabytes. I would first determine where the bottleneck is. Is it really the walsender, or is it on the network or in the standby server's replay? Check the difference between "sent_lsn", "replay_lsn" from "pg_stat_replication" and pg_current_wal_lsn() on the primary. Yours, Laurenz Albe -- Cybertec | https://www.cybertec-postgresql.com