how **cookie based affinity** works on vmss downsizing in Application Gateway

Raghava Sai Akula 346 Reputation points
2022-11-21T19:50:54.997+00:00

Hi there,
I was wondering how cookie based affinity in Application Gateway works while downsizing VMSS instance

I am having 2 VMSS instances with IIS installed & has 10+ .NET applications, if my CPU usage goes up by>70% for 5 mins if will spin up new instance(3rd instance) and route the traffic to the newly created one , but suddenly if the CPU percentage comes <50% then it will automatically delete newest instance that is created.
but what if one my request is still active on 3rd(newly created instance ). will my VM(3rd instance)wait for the request to complete or simply shutdown the instance?

Azure Virtual Machines
Azure Virtual Machines
An Azure service that is used to provision Windows and Linux virtual machines.
7,203 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.
965 questions
Azure Virtual Machine Scale Sets
Azure Virtual Machine Scale Sets
Azure compute resources that are used to create and manage groups of heterogeneous load-balanced virtual machines.
352 questions
0 comments No comments
{count} votes

Accepted answer
  1. msrini-MSFT 9,261 Reputation points Microsoft Employee
    2022-11-26T08:20:25.877+00:00

    Hi,

    You can configure the connection draining settings in the HTTP Settings of the Application gateway so the on-going session to the removed instance will exist for the configured time.

    Reference: https://learn.microsoft.com/en-us/azure/application-gateway/configuration-http-settings#connection-draining

    Regards,
    Karthik Srinivas

    0 comments No comments

1 additional answer

Sort by: Most helpful
  1. srbhatta-MSFT 8,546 Reputation points Microsoft Employee
    2022-11-25T05:14:51.747+00:00

    Hello @Raghava Sai Akula ,
    Welcome to Microsoft QnA Platform.
    The 3rd VMSS instance will not wait for the request to complete, the instance will be removed when your threshold value is reach (CPU < 50%) for over 5 minutes.
    Hope that clears your query. Let me know if you have any further questions.

    --------
    If you find the answer helpful, please accept as answer.

    0 comments No comments