Teradata Flow Control Mode

By Roland Wenzlofsky

March 9, 2014

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.

   ,MAX(WorkTypeMax00)    AS max_wrk0   
   ,MAX(WorkTypeMax01)    AS max_wrk1
   ,MAX(MailBoxDepth / CollectIntervals)
If you have any questions about all this, please ask in the comments! I’ll be paying close attention and answering as many as I can. Thank you for reading. Whatever this blog has become, I owe it all to you.
Buy now at Amazon
  • Hi Ronald – Thanks so much for explaining this topic in a very simple manner.

  • {"email":"Email address invalid","url":"Website address invalid","required":"Required field missing"}

    You might also like