PostgreSQL 12.17 Replication Slot Lag Persistent Growth

45 views
Skip to first unread message

Leon Kozlowski

unread,
Apr 25, 2024, 12:46:31 PM4/25/24
to debezium
Configuration:
PostgreSQL 12.17
Debezium 2.1.1.Final (Using Kinesis Connector)
Offset Store: Redis

We have been running CDC replication with Debezium on this database for over 1 year, however as of recently, the replication slot lag has grown to over 2TB and doesn't seem to be trending down much.

We have tried tuning the `max.bach.size` and `max.queue.size` parameters to keep up with the volume of the database, but this has not helped in combatting the replication slot lag growth.

The database is relatively high volume, with 8 million new records per day across all tables we are replicating.

This is a 8 month graph of the replication slot lag over time
Screenshot 2024-04-23 at 2.42.07 PM.png

We can see the slot lag growing since mid Feb - as we zoom in we can see hourly growth below
Screenshot 2024-04-23 at 2.41.46 PM.png

We have tried increasing `work_mem` on the database to allocate more memory to WAL process, however nothing has yielded results as of yet.

Looking for any guidance on tuning/techniques to combat this issue.

Thanks,
Leon

Reply all
Reply to author
Forward
0 new messages