|
1 | 1 | ---
|
2 |
| -title: Azure Virtual Desktop host pool load-balancing - Azure |
3 |
| -description: Learn about host pool load-balancing algorithms for a Azure Virtual Desktop environment. |
4 |
| -author: Heidilohr |
| 2 | +title: Host pool load balancing algorithms in Azure Virtual Desktop - Azure |
| 3 | +description: Learn about the host pool load balancing algorithms available for pooled host pools in Azure Virtual Desktop. |
| 4 | +author: dknappettmsft |
5 | 5 | ms.topic: conceptual
|
6 |
| -ms.date: 09/19/2022 |
7 |
| -ms.author: helohr |
8 |
| -manager: femila |
| 6 | +ms.date: 08/25/2023 |
| 7 | +ms.author: daknappe |
9 | 8 | ---
|
10 |
| -# Host pool load-balancing algorithms |
11 | 9 |
|
12 |
| ->[!IMPORTANT] |
13 |
| ->This content applies to Azure Virtual Desktop with Azure Resource Manager Azure Virtual Desktop objects. If you're using Azure Virtual Desktop (classic) without Azure Resource Manager objects, see [this article](./virtual-desktop-fall-2019/host-pool-load-balancing-2019.md). |
| 10 | +# Host pool load balancing algorithms in Azure Virtual Desktop |
14 | 11 |
|
15 |
| -Azure Virtual Desktop supports two load-balancing algorithms. Each algorithm determines which session host will host a user's session when they connect to a resource in a pooled host pool. The information in this article only applies to pooled host pools. |
| 12 | +Azure Virtual Desktop supports two load balancing algorithms for pooled host pools. Each algorithm determines which session host is used when a user starts a remote session. Load balancing doesn't apply to personal host pools because users always have a 1:1 mapping to a session host within the host pool. |
16 | 13 |
|
17 |
| -The following load-balancing algorithms are available in Azure Virtual Desktop: |
| 14 | +The following load balancing algorithms are available for pooled host pools: |
18 | 15 |
|
19 |
| -- Breadth-first load balancing allows you to evenly distribute user sessions across the session hosts in a host pool. You don't have to specify a maximum session limit for the number of sessions. |
20 |
| -- Depth-first load balancing allows you to saturate a session host with user sessions in a host pool. You have to specify a maximum session limit for the number of sessions. Once the first session host reaches its session limit threshold, the load balancer directs any new user connections to the next session host in the host pool until it reaches its limit, and so on. |
| 16 | +- **Breadth-first**, which aims to evenly distribute new user sessions across the session hosts in a host pool. You don't have to specify a maximum session limit for the number of sessions. |
21 | 17 |
|
22 |
| -Each host pool can only configure one type of load-balancing specific to it. However, both load-balancing algorithms share the following behaviors no matter which host pool they're in: |
| 18 | +- **Depth-first**, which keeps starting new user sessions on one session host until the maximum session limit is reached. Once the session limit is reached, any new user connections are directed to the next session host in the host pool until it reaches its session limit, and so on. |
23 | 19 |
|
24 |
| -- If a user already has an active or disconnected session in the host pool and signs in again, the load balancer will successfully redirect them to the session host with their existing session. This behavior applies even if that session host's AllowNewConnections property is set to False (drain mode is enabled). |
25 |
| -- If a user doesn't already have a session in the host pool, then the load balancer won't consider session hosts whose AllowNewConnections property is set to False during load balancing. |
26 |
| -- If you lower the maximum session limit on a session host while it has active user sessions, the change won't affect the active user sessions. |
| 20 | +You can only configure one of the load balancing at a time per pooled host pool, but you can change which one is used after a host pool is created. However, both load balancing algorithms share the following behaviors: |
27 | 21 |
|
28 |
| -## Breadth-first load-balancing algorithm |
| 22 | +- If a user already has an active or disconnected session in the host pool and signs in again, the load balancer will successfully redirect them to the session host with their existing session. This behavior applies even if [drain mode](drain-mode.md) has been enabled for that session host. |
29 | 23 |
|
30 |
| -The breadth-first load-balancing algorithm allows you to distribute user sessions across session hosts to optimize for session performance. This algorithm is ideal for organizations that want to provide the best experience for users connecting to their pooled virtual desktop environment. |
| 24 | +- If a user doesn't already have a session on a session host in the host pool, the load balancer doesn't consider a session host where drain mode has been enabled. |
31 | 25 |
|
32 |
| -The breadth-first algorithm first queries session hosts that allow new connections. The algorithm then selects a session host randomly from half the set of session hosts with the least number of sessions. For example, if there are nine machines with 11, 12, 13, 14, 15, 16, 17, 18, and 19 sessions, a new session you create won't automatically go to the first machine. Instead, it can go to any of the first five machines with the lowest number of sessions (11, 12, 13, 14, 15). |
| 26 | +- If you lower the maximum session limit on a session host while it has active user sessions, the change doesn't affect existing user sessions. |
33 | 27 |
|
34 |
| -## Depth-first load-balancing algorithm |
| 28 | +## Breadth-first load balancing algorithm |
35 | 29 |
|
36 |
| -The depth-first load-balancing algorithm allows you to saturate one session host at a time to optimize for scale down scenarios. This algorithm is ideal for cost-conscious organizations that want more granular control on the number of virtual machines they've allocated for a host pool. |
| 30 | +The breadth-first load balancing algorithm aims to distribute user sessions across session hosts to optimize for session performance. Breadth-first is ideal for organizations that want to provide the best experience for users connecting to their remote resources as session host resources, such as CPU, memory, and disk, are generally less contended. |
37 | 31 |
|
38 |
| -The depth-first algorithm first queries session hosts that allow new connections and haven't gone over their maximum session limit. The algorithm then selects the session host with highest number of sessions. If there's a tie, the algorithm selects the first session host in the query. |
| 32 | +The breadth-first algorithm first queries session hosts in a host pool that allow new connections. The algorithm then selects a session host randomly from half the set of available session hosts with the fewest sessions. For example, if there are nine session hosts with 11, 12, 13, 14, 15, 16, 17, 18, and 19 sessions, a new session doesn't automatically go to the session host with the fewest sessions. Instead, it can go to any of the first five session hosts with the fewest sessions at random. Due to the randomization, some sessions may not be evenly distributed across all session hosts. |
| 33 | + |
| 34 | +## Depth-first load balancing algorithm |
| 35 | + |
| 36 | +The depth-first load balancing algorithm aims to saturate one session host at a time. This algorithm is ideal for cost-conscious organizations that want more granular control on the number of session hosts available in a host pool, enabling you to more easily scale down when there are fewer users. |
| 37 | + |
| 38 | +The depth-first algorithm first queries session hosts that allow new connections and haven't reached their maximum session limit. The algorithm then selects the session host with most sessions. If there's a tie, the algorithm selects the first session host from the query. |
| 39 | + |
| 40 | +You must [set a maximum session limit](configure-host-pool-load-balancing.md#configure-depth-first-load-balancing) when using the depth-first algorithm. You can use Azure Virtual Desktop Insights to monitor [the number of sessions on each session host](insights-use-cases.md#session-host-utilization) and [session host performance](insights-use-cases.md#session-host-performance) to help determine the best maximum session limit for your environment. |
39 | 41 |
|
40 | 42 | > [!IMPORTANT]
|
41 |
| -> The maximum session limit parameter is required when you use the depth-first load balancing algorithm. For the best possible user experience, make sure to change the maximum session host limit parameter to a number that best suits your environment. |
42 |
| -> |
43 |
| -> Once all session hosts have reached the maximum session limit, you will need to increase the limit or deploy more session hosts. |
| 43 | +> Once all session hosts have reached the maximum session limit, you need to increase the limit or [add more session hosts to the host pool](add-session-hosts-host-pool.md). |
| 44 | +
|
| 45 | +## Next steps |
| 46 | + |
| 47 | +- Learn how to [configure load balancing for a host pool](configure-host-pool-load-balancing.md). |
| 48 | + |
| 49 | +- Understand how [autoscale](autoscale-scenarios.md) can automatically scale the number of available session hosts in a host pool. |
0 commit comments