Teradata manages the flow of work in a scalable and decentralized way on each AMP. Each AMP handles all the workload assigned to it on its own. Each AMP keeps track of the amount of work it is accepted, how much work is active, and how much work is waiting in a queue to be executed.
Flow control mode happens when the workload on an AMP reaches a specific limit. It will decline any further work assigned to it by the parsing engine. The state of an AMP not allowing any additional work is called flow control.
In flow control mode, the AMP will decline any newly arriving messages, such as new work, rows being sent by other AMPs, or internal system work.
Any message arriving on an AMP tries to get an AMP worker task to fulfill the required task. In the case of an All-AMP operation, such as a full table scan, it might happen that not all AMPs have free AMP worker tasks available.
Messages received by an AMP can be queued, and not all-AMPs have to begin immediately to work on the All-AMP task.
Still, each AMP’s message queues can only hold a limited amount of messages per work type (new work, second-level work, such as row distribution, etc.). Grouping queue messages by work type is used to prioritize them. For example, new work is not as important as ongoing work, needed to finish an already started task.
When any message queues reach the limit, further messages of the work type are no longer accepted. The dispatcher is informed by the AMP and will retry to send the messages until the AMP finally accepts them again. If only one AMP closes the gates, none of the AMPs will accept further work for the same message.
One or more AMPs in the state of flow control usually are a sign of system overload. Proper workload management has to be applied to bring the AMPs back to a normal state.
Flow control mode can cause severe performance problems if it happens repeatedly and over an extended period. Single occasions of flow control every once in a while and for a couple of seconds are acceptable.
Frequent flow control situations over an extended period should be analyzed in detail.
Below is a simple test query, which gives detailed information about flow control on a Teradata system.
It delivers, per sample period (i.e., the end of the period), the maximum tasks of type “new task,” “continued task,” the size of jobs queued, the number of flow control events, and the maximum parallel flow control events which occurred during the sample period.