Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question: Nginx Conf: in 'upstream' context, aren't "hash" and "least_conn" stanza conflicting ? #1846

Closed
JordanP opened this issue Dec 22, 2017 · 2 comments

Comments

@JordanP
Copy link
Contributor

JordanP commented Dec 22, 2017

First of all, thanks for your awesome, tremendous, impressive work.

I am using the new upstream-hash-by annotation introduced in #1490 (I love it ! makes my life so much easier, I had to hack rootfs/etc/nginx/template/ before that...). So the generated upstream block in my Nginx conf looks like:

    upstream default-rocco-5555 {
        # Load balance algorithm; empty for round robin, which is the default
        least_conn;
        hash $request_uri consistent;
        keepalive 32;
        server 10.132.0.21:5555 max_fails=0 fail_timeout=0;
        server 10.132.0.24:5555 max_fails=0 fail_timeout=0;
        server 10.132.0.3:5555 max_fails=0 fail_timeout=0;
        server 10.132.0.37:5555 max_fails=0 fail_timeout=0;
        server 10.132.0.5:5555 max_fails=0 fail_timeout=0;
        server 10.132.0.6:5555 max_fails=0 fail_timeout=0;
        server 10.132.0.8:5555 max_fails=0 fail_timeout=0;
    }

I find that both least_conn and hash being present is weird. I've browsed the Internet and I didn't find any example were both are defined. https://www.nginx.com/blog/choosing-nginx-plus-load-balancing-techniques/ makes me believe that they could be conflicting or that it doesn"t make sense to have both.

What do you think ?

@aledbf
Copy link
Member

aledbf commented Dec 25, 2017

@JordanP thank you for the report. You are right, we need to remove the load balance algorithm when has is being used. I will open a PR to fix this.

@aledbf aledbf added the bug label Dec 25, 2017
@aledbf
Copy link
Member

aledbf commented Dec 27, 2017

Closing. Fixed in #1858

@aledbf aledbf closed this as completed Dec 27, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants