grpc / grpc/grpc-java

Support for slow start with WRR Load Balancer Policy

Aperta
#12,087 8 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

enhancement
Lingua principale
Java
Stelle
12.1k
Fork
4k
Merge medio
2g 17h
PR unite (30g)
37

Descrizione

Is your feature request related to a problem?

https://github.com/grpc/grpc-java/issues/10688

Describe the solution you'd like

As per the above issue which was closed earlier, we recently tried WRR load balancing policy and with a few modification we can allow support for slow start. More details are available on the earlier issue.

In WRR conifg we have an option as blackout period which signifies that an endpoint when added to the address list, may be because it is a new endpoint or it has been removed before and added again, blackout period signify that we should wait for this much time before we start using the weights of this endpoint.

So as per the RFC we assign it mean weight of all the endpoints so it receives some amount of traffic, but this itself can be a huge traffic if the pod is just starting. We can may be use the blackout period seconds to clamp down this average weight and hence achieve a slow start result.

In the official envoy documentation we have the formula defined as

new_weight = weight * max(min_weight_percent, time_factor ^ (1/agression))
time_factor = max(time_start_in_seconds, 1) / slow_start_window_seconds

Here the aggression defines the slope of traffic increase and when it is 1 which is by default it increases traffic linearly.

We can either define and use the same configuration to update our weights or instead we can assume the aggression to be 1 and slow_start_window_seconds to be blackout_period and min_weight_percent = 0. We can also assume the weight here to be the mean_weight or the max_weight.

The formula can then be simplified as

new_weight = mean_weight * max(time_start_in_seconds, 1) / black_out_period

As per the definition of blackout_period it depends on the implementation how it chooses to send traffic, so if we define this logic for GRPC implementation, it should ideally not be an issue and yet we can achieve better results in comparison to the current implementation.

May be at a later stage we can consume the config directly and update weights to provide users more functionality to configure aggression and min_weight_percentage.

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia leggendo l’issue precedente collegata e la configurazione del bilanciamento del carico WRR, oltre al comportamento durante il periodo di blackout. Confronta la formula di slow-start proposta e le alternative di configurazione, quindi individua i punti di ingresso per l’implementazione e i test; il lavoro è completo quando esiste un design concordato per l’aggiornamento dei pesi e sono coperti gli endpoint aggiunti di recente o riaggiunti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
java
Ambito
backend, distributed-systems
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.