pingora icon indicating copy to clipboard operation
pingora copied to clipboard

Implement least connection load balancing algorithm

Open Kevin301099 opened this issue 1 year ago • 4 comments

Kevin301099 avatar Mar 18 '24 19:03 Kevin301099

Hi, is this issue available to work on?

beamandala avatar Mar 26 '24 13:03 beamandala

Our load balancing traits are public https://docs.rs/pingora-load-balancing/latest/pingora_load_balancing/selection/trait.BackendSelection.html.

@beamandala if you like to implement it, go for it. The code doesn't have to be in our libraries for people to use. Still, PRs are always welcomed.

eaufavor avatar Mar 27 '24 15:03 eaufavor

Thanks! Correct me if I'm wrong but if I wanted to make a pull request adding the least connection load balancing algorithm to pingora, I'm assuming I would have to follow a pattern similar to the weighted selection algorithm where I would add a connections field to the Backend struct and place the actual algorithm implementation in its own file?

beamandala avatar Mar 27 '24 20:03 beamandala

add a connections field to the Backend struct

I imagine you will track the connection info in your own struct. like ketama.

I don't think the Backend itself needs to be changed.

eaufavor avatar Mar 29 '24 18:03 eaufavor