Jump to content

Connect SuperML | Leeroopedia MCP: Equip your AI agents with best practices, code verification, and debugging knowledge. Powered by Leeroo — building Organizational Superintelligence. Contact us at founders@leeroo.com.

Principle:Apache Flink Congestion Control Rate Limiting

From Leeroopedia


Knowledge Sources
Domains Stream_Processing, Flow_Control
Last Updated 2026-02-09 00:00 GMT

Overview

A TCP-inspired congestion control mechanism that dynamically adjusts the rate of asynchronous requests based on success and failure feedback using AIMD (Additive Increase, Multiplicative Decrease) scaling.

Description

Congestion Control Rate Limiting prevents overwhelming the destination system by dynamically adjusting the allowed number of in-flight messages. Inspired by TCP congestion control, it uses an AIMD scaling strategy:

  • Additive Increase: On successful completion, increase the allowed messages by a fixed increment
  • Multiplicative Decrease: On failure (partial or complete), decrease the allowed messages by a multiplicative factor

The strategy also enforces absolute limits on concurrent in-flight requests. When the current in-flight count exceeds the dynamic limit, the writer blocks until capacity is available.

Usage

Use this principle when the destination system has variable throughput or can be overwhelmed by too many concurrent requests. The AIMD parameters should be tuned to the destinations characteristics: faster increase for stable systems, more aggressive decrease for fragile ones.

Theoretical Basis

ratet+1={ratet+increaseRateif successmax(threshold,ratet×decreaseFactor)if failure

// AIMD Algorithm
function scaleUp(currentRate):
    return currentRate + increaseRate    // e.g., +10

function scaleDown(currentRate):
    return max(rateThreshold, currentRate * decreaseFactor)  // e.g., * 0.5

function shouldBlock(requestInfo):
    return inFlightRequests >= maxInFlightRequests
        OR inFlightMessages >= maxInFlightMessages

Related Pages

Implemented By

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment