Slow replication with Neon CDC
Hey team, try to build a data pipeline with my neon db, and the replication process is super slow.
I'm sinking CDC events from 2 tables in my Neon DB table to flink cluster on AWS in the same region.
I increase the CPU to 7 and it doesn't seem to solve the problem.
any idea what can cause this issue?
1 Reply
national-gold•2y ago
With Neon's architecture, there's generally no need to scale for writes, at least on a single thread...
Write is only limited by disk IO at the safekeepers, which is independent of compute size.
It might have been possible, if you were CPU bound, that the replication threads were a lower priority or too much context switching, but your 7CU should have ruled that out of the equation.
Keep an eye on the the lag:
The
lsn_distance is measuring how far behind the subscriber is.
If the replication stream is generated too rapidly for the instance to keep up, the problem might be on the other end.
However, if you are holding open long running transactions, then the publisher will only stream the data once the transaction has been committed -- and you'll need to look at your DB transactions as the cause of the problem.