Web application lose session in ARR load balance [Answered]RSS

2 replies

Last post Apr 17, 2018 02:31 PM by jamwesker

  • Web application lose session in ARR load balance

    Apr 16, 2018 04:09 PM|jamwesker|LINK

    I would like to host three backend server behind the application request routing load balancer. However, the session always get lost. So how can I fix this? I would like to share the session for all three websites. Thanks in advance.

  • Re: Web application lose session in ARR load balance

    Apr 17, 2018 06:33 AM|Yuk Ding|LINK

    Hi Jamwesker,

    You had asked,” the session always get lost. So how can I fix this? I would like to share the session for all three websites.

    You need to use “client affinity” feature of ARR.

    Application Request Routing provides a client affinity feature that maps a client to a content server behind Application Request Routing for the duration of a client session. When this feature is enabled, the load balancing algorithm is applied only for the very first request from the client. From that point on, all subsequent requests from the same client would be routed to the same content server for the duration of the client session. This feature is useful if the application on the content server is stateful and the client's requests must be routed to the same content server because the session management is not centralized.

    To configure client affinity using the UI:

    1. Launch IIS Manager.
    2. Select the server farm, myServerFarm, which was created in Define and Configure an Application Request Routing (ARR) Server Group.
    3. The following icons are shown:
    4. Double-click Server Affinity.
    5. To enable client affinity, check the Client affinity checkbox, and then click Apply. Application Request Routing uses a cookie to enable client affinity. The Cookie name will be used to set the cookie on the client. That said, the client must accept cookies for client affinity to work properly.
    6. To verify the functionality of client affinity, send several requests to the ARR server. Refresh the dashboard in IIS Manager (Monitoring and Management). Verify that the runtime statistics are changing for only one of the application servers to where the client is affinitized. You may want to send additional requests and refresh the dashboard, as needed.

    Reference:

    https://docs.microsoft.com/en-us/iis/extensions/configuring-application-request-routing-arr/http-load-balancing-using-application-request-routing

    In addition, if you need to share the session, please try the sql server session state.

    https://msdn.microsoft.com/en-us/library/ms178586.aspx

    Regards

    Deepak

    Yuk Ding

    MSDN Community Support
    Please remember to "Mark as Answer" the responses that resolved your issue.
  • Re: Web application lose session in ARR load balance

    Apr 17, 2018 02:31 PM|jamwesker|LINK

    Hi yuk,

    Thank you for your help.