March 9


Teradata AMP Flow Control Mode

By Roland Wenzlofsky

March 9, 2014

flow control mode

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 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 certain limit. It will decline any further work assigned to it by the parsing engine. The state of an AMP not allowing any further work is called flow control.

In flow control mode, the AMP will decline any newly arriving messages, which can be, for example, 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, the message queues on each AMP 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. New work, for example, is not as important as ongoing work which is needed to finish an already started task.

When any of the message queues reaches 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 problem 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.

Roland Wenzlofsky

Roland Wenzlofsky is a graduated computer scientist and Data Warehouse professional working with the Teradata database system for more than 20 years. He is experienced in the fields of banking and telecommunication with a strong focus on performance optimization.

You might also like

  • 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"}

    Never miss a good story!

     Subscribe to our newsletter to keep up with the latest trends!