Connection draining is a process that ensures that existing, in-progress requests are given time to complete when a VM is removed from an instance group.
To enable connection draining, you set a connection draining timeout on the backend service.
The timeout duration must be from 1 to 3600 seconds.
To enable connection draining on a new or existing backend service by using the --connection-draining-timeout flag.
For example, when updating a backend service, provide the flag with your request:
gcloud compute backend-services update [BACKEND_SERVICE] \
--connection-draining-timeout [CONNECTION_TIMEOUT_SECS]
where:
-
[BACKEND_SERVICE] is the backend service for this request.
-
[CONNECTION_TIMEOUT_SECS] is the number of seconds to wait before instances are terminated, between 0 - 3600 seconds, inclusively. A setting of 0 disables connection draining. This timeout duration applies to all instance groups that are part of the backend service.