-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Graceful HTTP Connection Draining During Shutdown? #7841
Comments
We don't have this functionality today, but you can script around it using |
@mattklein123 thank you! Will stay subscribed for potential updates. |
Scripting around |
I'm considering building a more robust wrapper for doing hot reloads and graceful shutdowns 🤔 |
FYI @derekargueta when I run my Python load-testing tool against Envoy, then POST to Due to performance constraints, I have to use NLBs in my deployment, forwarding TCP packets rather than ALBs which understand HTTP, so it's not possible for me to use L7 HTTP health checks with my load balancer, rather just TCP opens to test connectivity. Is there a way to tell Envoy to stop accepting new TCP connections and finish up and close active HTTP connections? |
@naftulikay use the health checking filter and have the NLB health check the Envoy and it will stop sending new connections. |
So when an AWS load balancer is configured as a network load balancer (e.g. TCP forwarding), you can't use HTTP health checks against the instance. Rather, you have a boolean enabled or disabled of plain TCP-based health checks (e.g. "can I open a connection to the instance on the given port"). See the AWS documentation for more details. I'm currently digging through the HTTP health check filters to try to understand more about how they work. |
We use NLBs at Lyft with HTTP health checks. |
I'll ask our TAMs, but we have attempted to setup HTTP health checks on TCP target groups and the API fails creation. Our target groups are configured like so: resource "aws_lb_target_group" "http" {
name = "http"
port = 80
protocol = "TCP"
vpc_id = "${var.vpc_id}"
deregistration_delay = "${var.deregistration_delay}"
health_check {
enabled = true
interval = 10
port = "traffic-port"
protocol = "TCP"
healthy_threshold = 5
unhealthy_threshold = 5
}
tags {
Name = "http"
}
} |
(second'ing NLBs + HTTP healthchecks which is what we use as well) @naftulikay the |
Looks like the issue you're experiencing may be related to this thread: hashicorp/terraform-provider-aws#2708 (comment) |
This issue has been automatically marked as stale because it has not had activity in the last 30 days. It will be closed in the next 7 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions. |
Can someone tag this as help-wanted? This is still a desirable function to have and I think the community would benefit from it, even if it isn't implemented in the short term. |
FWIW this is a duplicate issue, see also #2920 (and other previous tickets which were marked solved.) |
There's no standard way in Thrift to notify a downstream that a server is about to go away, so this change proposes a configurable header name that will be used to signal an ongoing drain operation. Once we generally agree on the approach, I'll add: * tests * make hard-coded stuff configurable * possibly add an integration test Somewhat similar to envoyproxy#7841. Signed-off-by: Raul Gutierrez Segales <[email protected]>
Title: Graceful HTTP Connection Draining During Shutdown?
Description:
At my organization, we are preparing a large-scale Envoy deployment for serving all network traffic at the edge on ingress to our network. We are using static configuration files on disk and using the Python reloader script to execute hot reloads when our configuration on disk changes.
Sometimes, we need to stop and start the Envoy process completely.
I was hoping to see clean shutdown functionality similar to how NGINX handles a process shutdown. After a shutdown signal, NGINX stops accepting new TCP connections and attempts to complete all current HTTP requests with
Connection: close
to gracefully shut down the connections before stopping the process. This means that connections terminate cleanly, without a TCP close unless a timeout is exceeded.In a nutshell, NGINX does this:
$TIMEOUT
seconds for HTTP connections to terminate before terminating their TCP sockets.Connection: close
back in each response to cleanly close each connection.When I restart Envoy, either with SIGTERM or with the admin interface (
/quitquitquit
), I see TCP connection resets, rather thanConnection: close
. The hot reload process does connection closing properly, but it doesn't seem that shutdown does.Repro steps:
We are using Envoy 1.11.0 on Ubuntu 16.04 in AWS.
I have open-sourced our load-testing tool using the exact Python version,
requests
version, etc. to reliably reproduce the issue.Our systemd unit for running Envoy:
envoy.service
We are using the exact Python restarter tool that is currently in
master
.The script that we have the Python restarter tool run is this:
Config:
Logs:
The text was updated successfully, but these errors were encountered: