How does Azure AppGateway connection draining work with cookie-based affinity?

twilson 20 Reputation points
2024-09-24T19:03:40.7166667+00:00

We are looking to deploy an Azure scale set in combination with an AppGateway to take advantage of the scale in/out capabilities for our application VM's. The application does require session affinity so we would enable the cookie-based load balancing capabilities of the AppGateway. What is not entirely clear to me is how the connection draining works ... specifically does the configurable timeout value get reset each time a new request is received for an existing managed session?

For example, lets say the timeout value is set to 600s (10 minutes) and at time 'x', a scale-in operation designates a particular VM to be deregistered. Subsequently at time 'x + 9 minutes', a new request associated with an existing session on this VM is received by the AppGateway and passed on to the VM. At this point, does the timeout value get reset so that the VM would not be shutdown until 'x + 19 minutes' OR does the VM still get shutdown at 'x + 10 minutes'? Ideally we want the former so that the VM would not get shutdown until at least 10 minutes after the last request to the application VM.

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,832 questions
Azure Application Gateway
Azure Application Gateway
An Azure service that provides a platform-managed, scalable, and highly available application delivery controller as a service.
1,061 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. KapilAnanth-MSFT 44,691 Reputation points Microsoft Employee
    2024-09-25T07:34:35.62+00:00

    @twilson ,

    Welcome to the Microsoft Q&A Platform. Thank you for reaching out & I hope you are doing well.

    I understand that you would like to know if Session Affinity would impact the Connection Draining timeout value.

    Per your observation, even with Connection Draining enabled, a new request would land on the deregistering instances when Session Affinity enabled.

    The only exception to this are requests bound for deregistering instances because of gateway-managed session affinity and will continue to be forwarded to the deregistering instances

    I doubt this will any impact on the connection draining's timeout value. The App gateway will continue to send the traffic only till "x+10"th minute.

    Nevertheless, I shall confirm this internally once again and update this thread soon.

    P.S:

    • In your verbatim, I see you have mentioned "shutdown" of the VMs
    • Please note that App Gateway will only stop sending connections to the VM
    • App gateway does not control the "shut down" the VM by itself

    Cheers,

    Kapil


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.