cloudflare / cloudflare/pingora

Use GCD to reduce memory usage for WRR

Open
#51 1 comment 3 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
27.4k
Forks
1.7k
Avg merge
6h 22m
Merged PRs (30d)
3

Description

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

The current WRR algorithm will have additional memory overhead when the weights are not mutually prime, and because the current implementation is not smooth, extreme situations will occur, causing the backend to be overloaded or starved.

For example, it is common for everyone to set the weight to 100 or 1000 to facilitate weight adjustment. Then there will be a situation where the first 100 are all A, and the next 100 are all B (smooth WRR or shuffling is another topic).

## Describe the solution you'd like

Use GCD to reduce memory overhead and reduce load balancing cycles

## Describe alternatives you've considered

What other solutions, features, or workarounds have you considered that might also solve the issue?
What are the tradeoffs for these alternatives compared to what you're proposing?

## Additional context

Already implemented in the following RPC or gateway
https://github.com/cloudwego/kitex/issues/1014
https://github.com/alibaba/tengine/issues/1667

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.