Limit Message Rate avatar

Limit Message Rate

1 version
Open in App

Throttle message stream to target rate by selective forwarding

Use This When

  • Protecting downstream components or UIs from overwhelming message rates
  • Smoothing bursty data streams to consistent rate for recording or display
  • Reducing processing load by sampling high-frequency sensor or video streams
  • Implementing rate limiting for API endpoints or network-constrained outputs

What It Does

  • Estimates current message rate using exponential moving average or token bucket algorithm
  • Selectively forwards or drops messages to converge to target messages per second
  • High rate mode (≥1 msg/s): uses EMA to minimize error from target rate
  • Low rate mode (<1 msg/s): uses token bucket for precise fractional rate limiting

Works Best With

  • High FPS video → this component → visualization at display-appropriate frame rate
  • Sensor telemetry → this component → database storage at reduced sampling rate
  • Integration with output-browser-video to prevent browser rendering overload
  • Feeding network sinks that have bandwidth or rate constraints

Caveats

  • Drops messages to achieve rate; data is lost not delayed; use queueing if buffering needed
  • Time constant affects smoothness vs responsiveness tradeoff; tune based on burst patterns
  • Rate estimation reactive not predictive; brief bursts may exceed target before adaptation
  • No message prioritization; drops are based solely on timing not content importance

Versions

  • 81ed6801latestdefaultlinux/amd64

    Automated release