# Reduce Replication Lag | Percona Community

**URL:** <https://forums.percona.com/t/reduce-replication-lag-percona-community/20616>\
**Category:** Community website\
**Created:** [March 16, 2023, 12:08pm UTC](https://forums.percona.com/t/reduce-replication-lag-percona-community/20616 "2023-03-16T12:08:03Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniil.bazhenov](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/daniil.bazhenov/32/62_2.png) [@daniil.bazhenov](https://forums.percona.com/u/daniil.bazhenov)\
**Post date:** [March 16, 2023, 12:08pm UTC](https://forums.percona.com/t/reduce-replication-lag-percona-community/20616/1 "2023-03-16T12:08:03Z")

</div>

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:

* * *
This is a companion discussion topic for the original entry at [https://percona.community/blog/2022/06/01/speed-up-replication-lag/](https://percona.community/blog/2022/06/01/speed-up-replication-lag/)

---

<div class="post-metadata">

**Author:** ![Aleksandra\_Abramova](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/aleksandra_abramova/32/3038_2.png) [@Aleksandra\_Abramova](https://forums.percona.com/u/Aleksandra_Abramova)\
**Post date:** [March 27, 2023, 11:49am UTC](https://forums.percona.com/t/reduce-replication-lag-percona-community/20616/2 "2023-03-27T11:49:45Z")

</div>

Comment by Taylor Chu:

binlog\_transaction\_dependency\_tracking = writeset should be setting on primary, not sure why this blog mentioned setting on the replica. binlog\_group\_commit\_sync\_delay helps commit on the replica as binlog enabled by default on MySQL 8.0 . If the replica disabling the binlog, it also useless.

Setting binlog\_group\_commit\_sync\_delay can increase the number of parallel committing transactions on any server that has (or might have after a failover) a replica.  
[https://dev.mysql.com/doc/r…](https://disq.us/url?url=https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F8.0%2Fen%2Freplication-options-binary-log.html%23sysvar_binlog_group_commit_sync_delay%3AfNHO_0qWH_FmPeOXAcQJBVyfIqA&cuid=7336532)

binlog\_transaction\_dependency\_tracking specifies how the source mysqld generates the dependency information that it writes in the binary log to help replicas determine which transactions can be executed in parallel.  
[https://dev.mysql.com/doc/r…](https://disq.us/url?url=https%3A%2F%2Fdev.mysql.com%2Fdoc%2Frefman%2F8.0%2Fen%2Freplication-options-binary-log.html%23sysvar_binlog_transaction_dependency_tracking%3AdT4RvjWNd2zuJKJ05dr7me-71Wk&cuid=7336532)

Link to original comment:

> **[Peter Zaitsev on LinkedIn: Reduce Replication Lag](https://www.linkedin.com/feed/update/urn:li:activity:6941474642138198016/?commentUrn=urn%3Ali%3Acomment%3A%28activity%3A6941474642138198016%2C6941556639799865344%29)**
>
> How to reduce your MySQL replication lag https://lnkd.in/gAr9F8Nz #mysql

---

<div class="post-metadata">

**Author:** ![daniil.bazhenov](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/daniil.bazhenov/32/62_2.png) [@daniil.bazhenov](https://forums.percona.com/u/daniil.bazhenov)\
**Post date:** [March 27, 2023, 11:49am UTC](https://forums.percona.com/t/reduce-replication-lag-percona-community/20616/3 "2023-03-27T11:49:46Z")

</div>



---

<div class="post-metadata">

**Author:** ![Aleksandra\_Abramova](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/aleksandra_abramova/32/3038_2.png) [@Aleksandra\_Abramova](https://forums.percona.com/u/Aleksandra_Abramova)\
**Post date:** [March 27, 2023, 11:50am UTC](https://forums.percona.com/t/reduce-replication-lag-percona-community/20616/4 "2023-03-27T11:50:34Z")

</div>

Comment by @Wayne_Leutwyler:

Thank you for your comments. I had it in my notes to address this since in this post I am using 1 replica and 1 primary. In several other cases I do writeset on replicas. These cases include where I have replicas designed to be HA/DR fail over nodes, being managed by Orchestrator for automated failover.

---

<div class="post-metadata">

**Author:** ![Pavel\_Boguk](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/pavel_boguk/32/6773_2.png) [@Pavel\_Boguk](https://forums.percona.com/u/Pavel_Boguk)\
**Post date:** [April 18, 2025, 11:58am UTC](https://forums.percona.com/t/reduce-replication-lag-percona-community/20616/5 "2025-04-18T11:58:12Z")

</div>

Hi!

Have a question about this setting on primary:

> set global replica\_parallel\_workers = 4;

If I have 4 and more replicas(each has 4 replication threads) - which value of global replica\_parallel\_workers should be set on primary? 4х replica count?

---

<div class="post-metadata">

**Author:** ![Yunus](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/yunus/32/6430_2.png) [@Yunus](https://forums.percona.com/u/Yunus)\
**Post date:** [April 22, 2025, 1:54am UTC](https://forums.percona.com/t/reduce-replication-lag-percona-community/20616/6 "2025-04-22T01:54:29Z")

</div>

> [@Pavel\_Boguk](#):
>
> If I have 4 and more replicas(each has 4 replication threads) - which value of global replica\_parallel\_workers should be set on primary? 4х replica count?

replica\_parallel\_workers is needed on replica host. It enables multithreading for SQL thread for replica. It is not needed on primary.
