-
Notifications
You must be signed in to change notification settings - Fork 3.1k
feat: Add support for HTTP load balancing between the proxy and upstream server groups #2173
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
Conversation
I do! Thank you for the PR!
Yes.
I too would expect that test to fail. Some questions:
|
Given that the user provides the full line including the semicolon, maybe it would be better to just add an Two annoying things about my suggestion:
Maybe a compromise would be to rename the label in this PR from |
Thank you Richard! Your hints pointed me in the right direction and I had a small error in my compose file.
I was at first thinking to make the loadbalancing a true/false option. But then because of all flexible loadbalance options I decided to keep it clean and just insert the directive as-is from the label to prevent from a lot if/else stuff. I do like your suggestions. They gave me new ideas. My thoughts: Renaming to I rather would expand this PR to include the server weight and make a separate PR to include a upstream.d file. Which we can benefit from in more complex scenarios. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rhansen apart from the request change related to the feedback discussion and its inclusion in the docs, this LGTM (and yes we should squash the commits). |
…eam server groups Add initial tests Newlines Remove unused variable Co-authored-by: Richard Hansen <rhansen@rhansen.org> Change comment value Co-authored-by: Richard Hansen <rhansen@rhansen.org> add missing services line Co-authored-by: Richard Hansen <rhansen@rhansen.org> Use deploy.replicas Remove details about choosing a load balancing method Feedback note
Currently all connections are forwarded upstream with Round Robin algorithm. (default Nginx)
This pull request adds a container labels to specify the load balancing algorithm. Which can be used to have session persistence / affinity.
Some web applications which use the HTTP long-polling transport like websocket require sticky sessions.
Related #871, #299, #221, #886
Note if #1934 is merged: When using load balancing methods other than the default round-robin method, it is necessary to activate them before the keepalive directive.
If you think this PR is usefull I also plan to add the 'weight' directive.
I am trying to write a test. I have no pytest experience and having a little hard time to setup the test suite.
If I am correct the test webserver should output the container hostname.
But this always passes. In my first test when still using round robin I would expect this to fail.
Could someone point me in the right direction?