AirVantage / sbulb

UDP load balancer prototype using bcc (XDP/Bpf)
36 stars 9 forks source link

From "round-robin" to "random-pick" ? #8

Open sbernard31 opened 5 years ago

sbernard31 commented 5 years ago

Currently the algorithm to dispatch traffic is very simple. It's just a simple circular rotation :

  1. For 1st association we take the 1st real server,
  2. Then 2nd association we take the 2nd real server,
  3. After the last real server we go back to the beginning.

To do that we need a state : the last(or next) real server used.

The idea of "doing a random pick" was raised. This way we could remove the state. We could investigate this.

Maybe we can use : bpf_get_prandom_u32 helper function.