Nerdio Advisor: Logical Overview of VM Right Sizing for Shared Desktops

Nerdio Advisor: Logical Overview of VM Right Sizing for Shared Desktops

In this knowledge base article, we provide an in-depth explanation of the primary data used by the VM Right Sizing service for shared host pools.This data is critical for creating recommendations based on auto-scale history data. We also explore the various parameters, benchmarks, rule settings, and algorithms that drive the VM Right Sizing service.

Primary Data Overview

The VM Right Sizing service relies on primary data to create recommendations for optimizing the performance and resource utilization of virtual machines (VMs).

The VM Right sizing service (VMRSS) for shared host pools creates recommendations based on the same data as the auto-scale service. For correct service functionality, the following should be set:

  • Host pool type should be "dynamic."

  • Auto-scale should be turned on.

  • Gathering of CPU and RAM info should be turned on either in auto-scale settings or host pool properties.

Performance Counters

The following performance counters are used in the VM Right Sizing service:

  • "Processor Information/% Processor Time"

  • "Memory/Available MBytes"

The VM Right Sizing service calculates primary indicators using this data, which is then displayed in a detailed usage report on the Advisor > Recommendations page.

Note: CPU and RAM counters must be enabled either in the Auto-scale options dialog, host pool AVD Properties dialog, or both.

The VMRSS service calculates primary indicators using the data above. Indicators are shown in detailed usage report on the Advisor > Recommendations page.

Percentile Calculation

The below image and descriptions illustrate how values are calculated. Numbers in green are referenced in the description.

  1. The 90th percentile of processor load when any user session exists.

  2. The 90th percentile of processor load when active user sessions exist.

  3. The 90th percentile of % of used memory when any session exists.

  4. The 90th percentile of % of used memory when active user sessions exist.

Percentile is calculated as a level of CPU or memory usage. In the case of “90th percentile,” then 90% of the time VMs are observed to operate below the displayed value.

For example, a value of 28% for the 90th percentile on the chart below means that 90% of time CPU load is less than 28% of its full capacity and 10% of time over 28% of its capacity.

By default, recommendations consider indicators for active periods with any sessions (items 1 and 3 above). However, the assessment can be changed via rule settings to include only active sessions (2 and 4 above). However, If the active period is shorter than 72 hours, "any-session" indicators (1,3) are always used instead.

Some of the parameters above may be changed in the Advisor:HostPoolRightSize section of app service settings. See Parameter Customization below for details.

Chart Details

Please review the following sample chart which is filtered for the 90th percentile of CPU utilization.

  • The green and orange boxes on the chart axis show the total time of measurements (i.e., when the host was running).

  • The orange boxes mark times where processor load was more than 28% (indicated by the red dashed line).

  • The time values in the green boxes are 10 times greater than green orange boxes. This corresponds to the 90th percentile.

Note: Different hosts in host pool may have different VM sizes during the analysis period. VMRSS chooses the most-used VM size (greatest percentage) and creates recommendations based on that size. If choosing a most-used VM size is not possible, recommendations cannot be generated.

Data Requirement

To ensure reliable recommendations, the VM should be powered on for a minimum duration of 72 hours. This duration does not need to be continuous; it can accumulate over time (for example, 7 days with 10 hours per day, plus an additional 2 hours). If the data exists for less than 72 hours but more than 24 hours, recommendations are shown with a warning.

Data Analysis Period

The VM Right Sizing service analyzes data for the last 30 days. However, if a VM changes its size during this period, the analysis period may be shorter, because the data prior to the resizing is not taken into account.

Parameter Customization

Some of the parameters related to the VM Right Sizing service can be adjusted via the application service settings. These settings allow for fine-tuning the behavior of the service to match specific requirements. The following are the available settings:

Advisor:HostPoolRightSize:HideDataBelowDuration

This determines whether to display VM statistics to the user if the statistics period is shorter than this duration. Default: 1 (hour)

Advisor:HostPoolRightSize:HideOptionsBelowDuration

This determines whether to show recommended VM sizes to the user if the statistics period is shorter than this duration. Default: 24 (hours)

Advisor:HostPoolRightSize:ReliableStatisticsDuration

This setting determines when to show a warning if the statistics period is shorter than this duration. Default: 72 (hours)

Advisor:HostPoolRightSize: MaxStatisticsPeriod

This setting determines the period used for analysis. Default: 30 (days)

Advisor:HostPoolRightSize:Percentile

This specifies the baseline percentile used for calculations. Default: 90 (percentile)

Advisor:HostPoolRightSize:MinScale

This setting determines the minimum value for scale factor for CPU and RAM amount in a single recommendation. Default: 0.3 (scale factor for VM sizes)

Advisor:HostPoolRightSize:MaxScale

This setting determines the maximum value for scale factor for CPU and RAM amount in a single recommendation. Default: 3.0 (scale factor for VM sizes)

Ideal Scale Factor

When the VM Right Sizing service identifies a need to increase or decrease CPU or RAM resources, it calculates an ideal scale factor. The formula for calculating the scale factor is based on the usage and trigger values.

  • For an increase, the formula is: `factor = usage / Decrease Trigger`

  • For a decrease, the formula is: `factor = usage / Increase Trigger`

  • For optimal usage, the factor is set to 1.

The ideal scale factor cannot be more than 3 or less than 0.3. If it falls outside this range, it is adjusted to fit within it.

Ideal CPU/RAM

Using the ideal scale factors and benchmark data, the VM Right Sizing service calculates the ideal CPU performance and RAM capacity for each VM size. This information is used to make recommendations for resizing VMs.

Fuzzy-like Logic

In some cases, the VM Right Sizing service employs fuzzy-like logic to compare CPU performance, RAM capacity, and prices. This approach considers values with small differences as equal, using a noticeability ratio:

  • CPU Performance Ratio: 1.10

  • RAM Capacity Ratio: 1.05

  • Price Ratio: 1.02

This allows the service to respect values with minor differences as equivalent.

Size Picking

The VM Right Sizing service iterates through all available VM sizes for the same region and subscription to determine the optimal size. Several rejection criteria are applied, which prevents recommendations from being surfaced. These include:

  • Exhausted quotas

  • Missing benchmarks

  • Unknown prices

  • GPU availability mismatches

  • Missing features

  • Specific size families (A and B-size families are excluded from recommendation)

Sorting

Remaining sizes that pass the rejection criteria undergo sorting, and the algorithm used depends on the desired targets for CPU and RAM resources.

  • CPU Decrease or Increase: Simple sorting by price ascending.

  • Optimal RAM: Smart sorting, which considers both CPU and RAM needs for coverage.

  • RAM Increase: Smart sorting, which calculates a compound coverage score.

The final recommendation is typically based on the sorted list of sizes, and the first three sizes are saved to the database and displayed in the user interface.

Rule Settings

Rules that include the Right Sizing analyzer have specific settings that influence the behavior of the service. These settings include the triggers for CPU and RAM usage, as well as the "Active Sessions Only" flag.

Respect Quota

Optionally, this option tells the advisor to only recommend VM sizes when sufficient quota exists.

Specified VM Sizes

Optionally, this option tells the advisor to only recommend the specified VM sizes, with respect to other restrictions such as subscription, region, compatibility etc.

CPU Decrease Trigger

This indicates excessive CPU performance, and it is used to calculate the scale factor. Default: 60%

CPU Increase Trigger

This indicates insufficient CPU performance and is also used to calculate the scale factor. Default: 80%

RAM Decrease Trigger

This indicates excessive RAM amount and is used to calculate the scale factor. Default: 60%

RAM Increase Trigger

This indicates insufficient RAM amount and is also used to calculate the scale factor. Default: 80%

Active Sessions Only Flag

This specifies whether primary data for analysis should consider full usage (when disabled) or active sessions only (when enabled). Default: Enabled

Was this article helpful?

0 out of 0 found this helpful
Have more questions? Submit a request

Comments (0 comments)

Please sign in to leave a comment.