Replication Lag is just a fact of life with async-replication. We can’t stop lag, but we can help to reduce it. Many times the Seconds_Behind_Source can be very deciving, I have seen it go from 1 hour behind to 0 lag in the blink of an eye. There are many factors that can add to replica lag. Some of these are:
- Network IO
- Disk IO
- Database Workload
- Database settings
In this blog we will look a few database settings to help reduce lag. The settings we will look at are listed below.
- blinlog_transaction_dependency_tracking
- binlog_group_commit_sync_delay
- replica_parallel_type
- replica_parallel_workers
Hardware:
- Two Raspberry Pi 4 with 8GB of RAM.
- Sandisk 128GB Extreme microSDXC card.
Software:
- OS Raspbian Bullseye 64bit.
- Percona Server version …