Maxim Dounin
December 23, 2020 12:16PM
Hello!

On Wed, Dec 23, 2020 at 10:27:44AM -0500, Kenneth Brooks wrote:

> I have a fully working config doing loadbalancing over 2 upstream servers.
> I want to use "least_conn"
>
> When I put least_conn in, it still is doing round robin.
> I can confirm that other configs like "weight' and "ip_hash" are working as
> expected.
>
> Is there some other configuration/setting that also affects whether
> least_conn is honored?

The "least_conn" balancing method is equivalent to round-robin as
long as all configured upstream servers have equal number of
connections opened. That is, if you are seeing nginx is "doing
round robin", most likely this means that there isn't enough
active connections for least_conn to be different from
round-robin.

Note well that "number of connections" applies to a single nginx
worker process, and if there is more than one worker, least_conn
might not see all the connections (unless you've configured nginx
to share information about upstream servers between worker
processes, see http://nginx.org/r/zone).

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx mailing list
nginx@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx
Subject Author Posted

least_conn not working for me

kenneth.s.brooks December 23, 2020 10:28AM

Re: least_conn not working for me

kenneth.s.brooks December 23, 2020 10:57AM

Re: least_conn not working for me

Maxim Dounin December 23, 2020 12:16PM

Re: least_conn not working for me

kenneth.s.brooks December 23, 2020 12:36PM

Re: least_conn not working for me

kenneth.s.brooks December 23, 2020 01:12PM

Re: least_conn not working for me

pbooth December 23, 2020 02:08PM

Re: least_conn not working for me

Maxim Dounin December 23, 2020 04:28PM

Re: least_conn not working for me

kenneth.s.brooks December 23, 2020 04:44PM

Re: least_conn not working for me

philw December 23, 2020 05:00PM

Re: least_conn not working for me

Maxim Dounin December 23, 2020 05:16PM

Re: least_conn not working for me

kenneth.s.brooks December 23, 2020 05:40PM

Re: least_conn not working for me

kenneth.s.brooks December 25, 2020 08:04PM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 70
Record Number of Users: 6 on February 13, 2018
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready