# what is the meaning of the --max-flow-ctl

**URL:** <https://forums.percona.com/t/what-is-the-meaning-of-the-max-flow-ctl/6438>\
**Category:** Percona Toolkit\
**Created:** [July 2, 2018, 8:44pm UTC](https://forums.percona.com/t/what-is-the-meaning-of-the-max-flow-ctl/6438 "2018-07-02T20:44:14Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Fan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/fan/32/40_2.png) [@Fan](https://forums.percona.com/u/Fan)\
**Post date:** [July 2, 2018, 8:44pm UTC](https://forums.percona.com/t/what-is-the-meaning-of-the-max-flow-ctl/6438/1 "2018-07-02T20:44:14Z")

</div>

Can someone explain the meaning of the --max-flow-ctl parameter, do not understand how this percentage is calculated

---

<div class="post-metadata">

**Author:** ![Fan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/fan/32/40_2.png) [@Fan](https://forums.percona.com/u/Fan)\
**Post date:** [July 2, 2018, 9:06pm UTC](https://forums.percona.com/t/what-is-the-meaning-of-the-max-flow-ctl/6438/2 "2018-07-02T21:06:31Z")

</div>

My understanding is that A = $ (when spent on flow control (from the start of pt-osc/pt-archiver) / start executing pt-osc/pt-archiver to the current total duration \* 100)  
Pt-osc/pt-archiver is suspended when A \> —max-flow-ctl specifies the value. Over time, when A \< —max-flow-ctl specifies the value, continue to execute pt-osc/pt -archiver  
I don’t know if it’s right

---

<div class="post-metadata">

**Author:** ![Fan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/fan/32/40_2.png) [@Fan](https://forums.percona.com/u/Fan)\
**Post date:** [July 17, 2018, 9:08am UTC](https://forums.percona.com/t/what-is-the-meaning-of-the-max-flow-ctl/6438/3 "2018-07-17T09:08:58Z")

</div>

Can someone answer my question?

---

<div class="post-metadata">

**Author:** ![Michael\_Coburn](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/michael_coburn/32/18_2.png) [@Michael\_Coburn](https://forums.percona.com/u/Michael_Coburn)\
**Post date:** [July 17, 2018, 9:26am UTC](https://forums.percona.com/t/what-is-the-meaning-of-the-max-flow-ctl/6438/4 "2018-07-17T09:26:05Z")

</div>

Hi [Fan](https://percona.vanillacommunities.com/profile/x/x/41523) - this setting in pt-archiver ensures that the archiving routine doesn’t overwhelm a PXC cluster by setting a limit to how far replication can lag other members of the cluster.

From the documentation:  
[https://www.percona.com/doc/percona-toolkit/LATEST/pt-archiver.html#cmdoption-pt-archiver-max-flow-ctl](https://www.percona.com/doc/percona-toolkit/LATEST/pt-archiver.html#cmdoption-pt-archiver-max-flow-ctl)

> [@](#):
>
> Somewhat similar to --max-lag but for PXC clusters. Check average time cluster spent pausing for Flow Control and make tool pause if it goes over the percentage indicated in the option. Default is no Flow Control checking.

And background on PXC Flow Control:  
[https://www.percona.com/blog/2013/05/02/galera-flow-control-in-percona-xtradb-cluster-for-mysql/](https://www.percona.com/blog/2013/05/02/galera-flow-control-in-percona-xtradb-cluster-for-mysql/)  
What is flow control?

> [@](#):
>
> One of the things that people don’t often expect when switching to Galera is existence of a replication feedback mechanism, unlike anything you find in standard async MySQL replication. It is my belief that the lack of understanding of this system, or even that it exists, leads to unnecessary frustration with Galera and cluster “stalls” that are preventable.
> 
> This feedback, called flow control, allows any node in the cluster to instruct the group when it needs replication to pause and when it is ready for replication to continue. This prevents any node in the synchronous replication group from getting too far behind the others in applying replication.
> 
> This may sound counter-intuitive at first: how would synchronous replication get behind? As I’ve mentioned [before](https://www.percona.com/blog/2012/11/20/understanding-multi-node-writing-conflict-metrics-in-percona-xtradb-cluster-and-galera/), Galera’s replication is synchronous to the point of ensuring transactions are copied to all nodes and global ordering is established, but apply and commit is asynchronous on all but the node the transaction is run on.

I hope this helps!

---

<div class="post-metadata">

**Author:** ![Fan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/fan/32/40_2.png) [@Fan](https://forums.percona.com/u/Fan)\
**Post date:** [July 18, 2018, 8:31pm UTC](https://forums.percona.com/t/what-is-the-meaning-of-the-max-flow-ctl/6438/5 "2018-07-18T20:31:39Z")

</div>

> [@Michael Coburn;51879](#):
>
> Hi [Fan](https://percona.vanillacommunities.com/profile/x/x/41523) - this setting in pt-archiver ensures that the archiving routine doesn’t overwhelm a PXC cluster by setting a limit to how far replication can lag other members of the cluster.
> 
> From the documentation:  
> [https://www.percona.com/doc/percona-toolkit/LATEST/pt-archiver.html#cmdoption-pt-archiver-max-flow-ctl](https://www.percona.com/doc/percona-toolkit/LATEST/pt-archiver.html#cmdoption-pt-archiver-max-flow-ctl)
> 
> And background on PXC Flow Control:  
> [https://www.percona.com/blog/2013/05/02/galera-flow-control-in-percona-xtradb-cluster-for-mysql/](https://www.percona.com/blog/2013/05/02/galera-flow-control-in-percona-xtradb-cluster-for-mysql/)  
> What is flow control?
> 
> I hope this helps!

First of all, I want to express my gratitude, but this does not answer my question very well…  
I want to know the algorithm of this parameter

---

<div class="post-metadata">

**Author:** ![carlos.salguero](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/carlos.salguero/32/20_2.png) [@carlos.salguero](https://forums.percona.com/u/carlos.salguero)\
**Post date:** [July 23, 2018, 10:20am UTC](https://forums.percona.com/t/what-is-the-meaning-of-the-max-flow-ctl/6438/6 "2018-07-23T10:20:59Z")

</div>

Hi,

The part of the code checking the lag/flow control is here:  
[URL][percona-toolkit/pt-archiver at 3.0 · percona/percona-toolkit · GitHub](https://github.com/percona/percona-toolkit/blob/3.0/bin/pt-archiver#L4384-L4387%5B/URL%5D)

Regards

---

<div class="post-metadata">

**Author:** ![Fan](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.percona.com/fan/32/40_2.png) [@Fan](https://forums.percona.com/u/Fan)\
**Post date:** [July 24, 2018, 3:03am UTC](https://forums.percona.com/t/what-is-the-meaning-of-the-max-flow-ctl/6438/7 "2018-07-24T03:03:45Z")

</div>

> [@carlos.salguero;51940](#):
>
> Hi,
> 
> The part of the code checking the lag/flow control is here:  
> [https://github.com/percona/percona-toolkit/blob/3.0/bin/pt-archiver#L4384-L4387](https://github.com/percona/percona-toolkit/blob/3.0/bin/pt-archiver#L4384-L4387)
> 
> Regards

thanks a lot !
