I have a large table (over 35 million rows, most rows contain TOAST'd columns) that I've isolated as the source of growing replication delays in my Postgres instance. When I'm doing inserts into this table (at a rate of 100s per second) I see the replication delay, both in time and bytes, grow. The only way I get the replication delay to come back down is to either stop doing inserts into this table or truncate this table and allow the inserts to proceed. Based on my testing this issue seems to pop up somewhere in the neighborhood of 30 million rows, and not before.
To give you an idea of volume, I'm normally shipping about 200 MB/s of xlogs to the replica, have already tested and verified I can do over 1 GB/s when this table is not an issue, so I know it's not a network problem.
Any ideas as to why this happens and what I can do to address it? Thanks to a previous round of trying to address this problem I've already turned on wal compression and use replication slots now.