cloudflare / pingora

A library for building fast, reliable and evolvable network services.
Apache License 2.0
20.28k stars 1.1k forks source link

Implement the smooth weighted round-robin balancing for pingora. #195

Open wathenjiang opened 2 months ago

wathenjiang commented 2 months ago

What is the problem your feature solves, or the need it fulfills?

The current weighted round-robin balancing algorithm does not ensure smoothness, which can result in requests being distributed to the same backend in short term.

Describe the solution you'd like

By referring to the implementation of nginx, we can solve this problem.

Describe alternatives you've considered

See https://github.com/cloudflare/pingora/pull/194 please.