Note:
This topic has been translated from a Chinese forum by GPT and might contain errors.
Original topic: 通过pump + drainer来实现主从同步,但存在一定延迟。
[TiDB Usage Environment] Production Environment
[TiDB Version] 4.0.15
[Reproduction Path] Delay between master and slave
[Encountered Problem: Phenomenon and Impact]
Not sure if it will affect master-slave synchronization

Check the monitoring of the replica to see if the performance has reached its bottleneck.
I have already adjusted the txn-batch and worker-count parameters, and the threads are also in a sleep state. There is also high latency from pump to drainer.
Insufficient performance of the replica.
Check the dashboard of the replica.
The image is not available for translation. Please provide the text content directly.
It’s too old technology, and it would be better to put TiDB resources together.
It is normal for the primary database to have delays due to large transaction binlogs.
How do you check here if it’s a large transaction or parse the binlog, just like MySQL?
Check the drainer logs, there will be a prompt for large binlogs.
The image is not visible. Please provide the text you need translated.
What’s going on with your PD timestamp wait? GC? Memory? Network?
The problem is right here, why is there a delay?
You should search for these keywords.
Check what transactions these large logs are performing.
The screenshot already shows no large transactions.