cilium / cilium

eBPF-based Networking, Security, and Observability
https://cilium.io
Apache License 2.0
19.16k stars 2.78k forks source link

bandwidth-manager: introduce ecn marking to prevent bufferbloat #33220

Open middaywords opened 1 week ago

middaywords commented 1 week ago

Currently the bandwidth manager is enforcing a rate limit for flows in one pod, and the flows in one pod are sharing one same queue. It's using tail drop policy with threshold as 2 seconds. This can cause bufferbloat and 2-second queuing latency when there are many tcp connections.

Here we introduce ecn marking to solve the issue, by default, the marking threshold is set to 1ms.

For tests, we had a pod with 100Mbps egress limit, and there are 128 TCP connections in the pod as background traffic, and we compare the TCP_RR latency

Method | Avg Latency with-ECN | 3.1ms without-ECN | 2247.3ms

Please ensure your pull request adheres to the following guidelines:

Fixes: #29083

bandwidth-manager: introduce ecn marking to prevent bufferbloat
middaywords commented 1 week ago

I see, will fix. thanks