mirror of
https://git.haproxy.org/git/haproxy.git/
synced 2026-03-14 03:22:06 +01:00
MEDIUM: backend: make "balance random" consider tg local req rate when loads are equal
This is a follow up to b6bdb2553 ("MEDIUM: backend: make "balance random"
consider req rate when loads are equal")
In the above patch, we used the global sess_per_sec metric to choose which
server we should be using. But the original intent was to use the per
thread group statistic.
No backport needed, the previous patch already improved the situation in
3.3, so let's not take the risk of breaking that.
This commit is contained in:
parent
1274c21a42
commit
747ff09818
@ -585,8 +585,8 @@ struct server *get_server_rnd(struct stream *s, const struct server *avoid)
|
||||
curr = prev;
|
||||
else if (wcurr == wprev && curr->counters.shared.tg && prev->counters.shared.tg) {
|
||||
/* same load: pick the lowest weighted request rate */
|
||||
wcurr = read_freq_ctr_period_estimate(&curr->counters._sess_per_sec, MS_TO_TICKS(1000));
|
||||
wprev = read_freq_ctr_period_estimate(&prev->counters._sess_per_sec, MS_TO_TICKS(1000));
|
||||
wcurr = read_freq_ctr_period_estimate(&curr->counters.shared.tg[tgid - 1]->sess_per_sec, MS_TO_TICKS(1000));
|
||||
wprev = read_freq_ctr_period_estimate(&prev->counters.shared.tg[tgid - 1]->sess_per_sec, MS_TO_TICKS(1000));
|
||||
if (wprev * curr->cur_eweight < wcurr * prev->cur_eweight)
|
||||
curr = prev;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user