Welcome! Log In Create A New Profile

Advanced

Re: Difference between weight, current_weight, effective_weight, etc?

May 16, 2018 01:52PM
Ahh, thanks a lot for the reference and sorry for the late reply, Maxim.

So reading that and assuming I’m already collecting via an OOB/async call
the weights of each server (the idea is to change the weights dynamically),
then when I notice a change in the weight of one of the peers the things I
should update are:

For round-robin:

- the -> weight of the peer (I assume via get_peer): the new dynamic value..
- The effective_weight: the new dynamic value.
- Reset the current_weight to 0.
- Update total_weights for the upstream group.

As for least conn, hash and others looks like we similar changes would also
be needed.

Am I a bit lost or in the right path? ;-D

On Mon, May 14, 2018 at 8:18 PM Maxim Dounin <mdounin@mdounin.ru> wrote:

> Hello!
>
> On Mon, May 14, 2018 at 08:04:22PM -0700, Pablo Fischer wrote:
>
> > We are looking (unless it already exists) to add load feedback
> > functionality to our setup, this basically means to have an API
> > (either lua or through C) that we can use to change the weight of
> > servers "dynamically" (either async or by hitting a specific URL).
> >
> > However when reading the code I'm a little confused on the difference
> > between those weight variables, seems that sometimes you compare them
> > against each other so not sure what is the difference in them.
> >
> > What is the difference between weight, current_weight and
> > effective_weight? I'm assuming that total_weight is the sum of all
> > weights (weight?) for a given upstream.
>
> Try reading this commit:
>
> http://hg.nginx.org/nginx/rev/c90801720a0c
>
> --
> Maxim Dounin
> http://mdounin.ru/
> _______________________________________________
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel
>
>
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

Difference between weight, current_weight, effective_weight, etc?

pfischer 458 May 14, 2018 11:06PM

Re: Difference between weight, current_weight, effective_weight, etc?

Maxim Dounin 204 May 14, 2018 11:20PM

Re: Difference between weight, current_weight, effective_weight, etc?

pfischer 245 May 16, 2018 01:52PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 166
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready