automq icon indicating copy to clipboard operation
automq copied to clipboard

fix(core): fix outbound bandwidth limiter token refill and metrics baseline

Open yx9o opened this issue 2 months ago • 4 comments

Outbound baseline bandwidth is configured as networkBaselineBandwidth * 5, but refillToken and metrics calculation were still using inbound baseline. This caused dashboard outbound available bandwidth to always show negative values. image

yx9o avatar Nov 15 '25 14:11 yx9o

The negative values are caused by actual network exhaustion.

networkBaselineBandwidth * 5 is the max token size for the network bursting.

The metrics mean that the available bandwidth = network baseline - network consumption rate

superhx avatar Nov 15 '25 14:11 superhx

In our actual production scenarios, outbound traffic is often larger than inbound traffic; for example, it's common for multiple groups to consume the same topic. Therefore, the baseline bandwidth of the outbound traffic should be adjusted to be larger than the baseline bandwidth of the inbound traffic. Otherwise, this metric will always be negative, making it difficult to determine the actual outbound bandwidth.

yx9o avatar Nov 15 '25 14:11 yx9o

In our actual production scenarios, outbound traffic is often larger than inbound traffic; for example, it's common for multiple groups to consume the same topic. Therefore, the baseline bandwidth of the outbound traffic should be adjusted to be larger than the baseline bandwidth of the inbound traffic. Otherwise, this metric will always be negative, making it difficult to determine the actual outbound bandwidth.

In AWS / GCP / Azure, the inbound network and the outbound network are isolated. So setting the same baseline of the inbound network and outbound network is fine.

Is your environment's network shared by both inbound and outbound?

superhx avatar Nov 15 '25 15:11 superhx

Um, we are using it in a self-built data center, where the bandwidth is relatively sufficient. The outbound traffic is many times that of the inbound traffic. We would like to set different baseline bandwidths for the inbound and outbound traffic. Do you have any good suggestions for modification?

yx9o avatar Nov 15 '25 15:11 yx9o

Um, we are using it in a self-built data center, where the bandwidth is relatively sufficient. The outbound traffic is many times that of the inbound traffic. We would like to set different baseline bandwidths for the inbound and outbound traffic. Do you have any good suggestions for modification?

If the inbound and outbound traffic in a self-built data center share the same bandwidth, perhaps we should create an AsyncNetworkBandwidthLimiter that is shared by both inbound and outbound traffic.

superhx avatar Nov 17 '25 01:11 superhx

My idea is to keep the peak value of out as baseline * 5, and to differentiate the baseline of out from that of in. For example, out could be baseline * 2 (this 2 is a coefficient, the default is 1, and it would be best if it were configurable).

yx9o avatar Nov 17 '25 04:11 yx9o