Hi there, I have a postgres CDC source that’s runn...
# replication-ask-ai
j
Hi there, I have a postgres CDC source that’s running very slowly. The logs below show that it takes 2.5 minutes to sync 20 records.
Copy code
2023-09-04 15:47:45 source > 8 records sent during previous 00:00:10.792, last recorded offset: {transaction_id=null, lsn_proc=308113816, lsn_commit=308113816, lsn=308113816, txId=1286, ts_usec=1693842393073417}
2023-09-04 15:47:55 source > 1 records sent during previous 00:00:10.022, last recorded offset: {transaction_id=null, lsn_proc=308113816, lsn_commit=308113816, lsn=308113816, txId=1286, ts_usec=1693842393073417}
2023-09-04 15:48:15 source > 2 records sent during previous 00:00:20.042, last recorded offset: {transaction_id=null, lsn_proc=308113816, lsn_commit=308113816, lsn=308113816, txId=1286, ts_usec=1693842393073417}
2023-09-04 15:48:55 source > 4 records sent during previous 00:00:40.593, last recorded offset: {transaction_id=null, lsn_proc=308113816, lsn_commit=308113816, lsn=308113816, txId=1286, ts_usec=1693842393073417}
2023-09-04 15:50:16 source > 8 records sent during previous 00:01:20.691, last recorded offset: {transaction_id=null, lsn_proc=308113816, lsn_commit=308113816, lsn=308113816, txId=1286, ts_usec=1693842393073417}
Why is this the case? What can I do to speed up the postgres CDC source connector?
k
The slow sync speed you're experiencing with your Postgres CDC source could be due to a number of factors. Here are a few potential reasons and solutions based on the information provided in the extracts: 1. Initial CDC Waiting Time: The Postgres connector may need some time to start processing the data in the CDC mode, especially when the connection is set up for the first time and a snapshot is needed or when the connector has a lot of change logs to process. The connector waits for the default initial wait time of 5 minutes (300 seconds). If you know there are database changes to be synced, but the connector cannot read those changes, the root cause may be insufficient waiting time. In that case, you can increase the waiting time (example: set to 600 seconds) to test if it is indeed the root cause. On the other hand, if you know there are no database changes, you can decrease the wait time to speed up the zero record syncs. [source](https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting) 2. Database Updates and WAL Files: When there are lots of database updates resulting in more WAL files than allowed in the
pg_wal
directory, Postgres will purge or archive the WAL files. This scenario is preventable. Possible solutions include syncing the data source more frequently or setting a higher
wal_keep_size
. [source](https://docs.airbyte.com/integrations/sources/postgres/postgres-troubleshooting) 3. Connector Versions: Ensure you're using the latest version of the Postgres source connector. Recent updates have included performance improvements and bug fixes that could potentially address your issue. [source](https://docs.airbyte.com/integrations/sources/postgres) If none of these solutions work, it would be helpful to have more information about your setup, such as the size of your database, the frequency of your syncs, and the specific configuration of your Postgres source.