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

Add annotations to configure retries, max connections to a service #241

Merged

Conversation

cmaloney
Copy link

@cmaloney cmaloney commented Feb 14, 2018

These are needed in order to scale a service up as well as help cope
with when a pod for a kubernetes service disappears unexpectedly. By
default Envoy has a limit of 1024 simultaneous connections to a cluster
and doesn't do any retries. A single http server backend of a service
can handle tens of thousands of requests per second however, and in
environments where that happens the low limit of envoy causes envoy to
circuit break those services rather than "flood" an unsuspecting backend
with requests.

By default, envoy doesn't retry requests, which means if a request gets
made to a pod which is the process of exiting / just stopped responding
to connections (Say it segfaulted) the request gets dropped and the
client sees an error rather than a retry. The retry annotations allow
changing this policy as appropriate in the environment

Signed-off-by: Cody Maloney cody@emeraldcloudlab.com

TODO:

  • Test for parseAnnotationUInt32

If wanted, I can add new tests around the service + ingress specifically that the annotations get handled / passed thorugh correctly

@cmaloney cmaloney force-pushed the ingress-annotation-retries branch 2 times, most recently from 826c2ba to 1ae96f9 Compare February 14, 2018 03:20
@davecheney
Copy link
Contributor

Looks pretty good to me. Sadly there will be a merge conflict after #240. Hopefully this will be the last big change to the grpc types in the 0.4 cycle.

@cmaloney cmaloney force-pushed the ingress-annotation-retries branch from 1ae96f9 to a1f9384 Compare February 16, 2018 23:33
@cmaloney cmaloney changed the title WIP: Add annotations to configure retries, max connections to a service Add annotations to configure retries, max connections to a service Feb 16, 2018
@cmaloney cmaloney force-pushed the ingress-annotation-retries branch from a1f9384 to c1d1f3f Compare February 20, 2018 20:38
@cmaloney
Copy link
Author

@davecheney rebased on master. Has unit tests around the Uint32 annotation parsing. If there's anything else needed let me know

These are needed in order to scale a service up as well as help cope
with when a pod for a kubernetes service disappears unexpectedly. By
default Envoy has a limit of 1024 simultaneous connections to a cluster
and doesn't do any retries. A single http server backend of a service
can handle tens of thousands of requests per second however, and in
environments where that happens the low limit of envoy causes envoy to
circuit break those services rather than "flood" an unsuspecting backend
with requests.

By default, envoy doesn't retry requests, which means if a request gets
made to a pod which is the process of exiting / just stopped responding
to connections (Say it segfaulted) the request gets dropped and the
client sees an error rather than a retry. The retry annotations allow
changing this policy as appropriate in the environment

Signed-off-by: Cody Maloney <cody@emeraldcloudlab.com>
@cmaloney cmaloney force-pushed the ingress-annotation-retries branch from c1d1f3f to c6f1df4 Compare February 26, 2018 20:08
@Lookyan
Copy link
Contributor

Lookyan commented Mar 11, 2018

Any updates here?
It's very useful functionality.

@davecheney davecheney merged commit c6f1df4 into projectcontour:master Mar 12, 2018
davecheney added a commit to davecheney/contour that referenced this pull request Mar 12, 2018
davecheney added a commit to davecheney/contour that referenced this pull request Mar 12, 2018
Signed-off-by: Dave Cheney <dave@cheney.net>
davecheney added a commit to davecheney/contour that referenced this pull request Mar 12, 2018
Updates projectcontour#241

Signed-off-by: Dave Cheney <dave@cheney.net>
davecheney added a commit to davecheney/contour that referenced this pull request Mar 12, 2018
Signed-off-by: Dave Cheney <dave@cheney.net>
alvaroaleman pushed a commit to alvaroaleman/contour that referenced this pull request Mar 12, 2018
Updates projectcontour#241

Signed-off-by: Dave Cheney <dave@cheney.net>
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

Successfully merging this pull request may close these issues.

3 participants