Blog Post

Core Infrastructure and Security Blog
10 MIN READ

Understanding ConfigMgr Software Inventory Throttling

jonasoh's avatar
jonasoh
Icon for Microsoft rankMicrosoft
Aug 17, 2020

 

Hi, Jonas here!

Or as we say in the north of Germany: "Moin Moin!"
I am a Customer Engineer based in Germany and a while back I was asked about the software inventory (SINV) throttling process and if it can be adjusted to perform a little faster without any noticeable impact to the user experience.

Yes, I know, not the newest ConfigMgr/MECM feature and if you had the same question in the past, you might find several resources talking about disabling the throttling mechanism completely, so my first answer to the above question was: "No, not possible!".

But the customer asked about a timeout value he found in the InventoryAgent.log and if at least that could be adjusted to improve the process.

So, I started digging and this blog post is the summary of my findings.

 

 

TL;DR

Software Inventory (SINV) can be slow on some machines and might not finish at all, because of the internal throttling behavior of SINV, which was implemented to keep the system as responsive as possible for the user using the system.

The throttling mechanism can be adjusted to fit the needs of your environment and this blog post is intended to point you in the right direction.

You will find a link to a git repository at the bottom with some resources I am explaining in the “PowerShell to the help” section.

If you do not intent to change anything about SINV or not using it at all, you will at least learn how throttling the SINV process works 😉

 

 

How the ConfigMgr Client is throttling SINV:

Software Inventory is using three different tasks to perform the software inventory scan.

One task to look for files, one task to grab files if activated in client settings and one task to put the data in WMI.

Each task has its own throttling profile which is stored in the default client policy.

A profile ID for such task like "{C0ED66AD-8194-49fd-9826-D0DD38AB7DAA}” is what you normally see in the InventoryAgent.log during SINV scans.

Each profile has several different throttling thresholds which all define when throttling should be activated or deactivated.

 

The three WMI instances look like this: 

(with the default values)

 

Task profile 1:

instance of CCM_Service_ResourceProfileInformation

{

    // File System Collection Task - processing SINV WMI instances

    ProfileID = "{C0ED66AD-8194-49fd-9826-D0DD38AB7DAA}";

     // BatchSize not used

    ControlUsage = true;

    OnAC_PercentageOfTimeoutToWait = 50;

    OnAC_EvaluationPeriodLengthSec = 60;

    OnAC_IdlePeriodLengthSec = 120;

    OnAC_MinIdleDiskPercentage = 0;

    OnAC_ConsiderUserInputAsActivity = true;

    OnBattery_BehaviorType = 1;

    OnLowBattery_BehaviorType = 0;

};

 

Task profile 2:

instance of CCM_Service_ResourceProfileInformation

{

    // File Collection Task - processing FILECOLL WMI instances

    ProfileID = "{CE22C5BA-165D-4b93-BC73-926CE1BD9279}";

     // BatchSize not used

    ControlUsage = true;

    OnAC_PercentageOfTimeoutToWait = 50;

    OnAC_EvaluationPeriodLengthSec = 60;

    OnAC_IdlePeriodLengthSec = 120;

    OnAC_MinIdleDiskPercentage = 0;

    OnAC_ConsiderUserInputAsActivity = true;

    OnBattery_BehaviorType = 1;

    OnLowBattery_BehaviorType = 0;

};

 

Task profile 3:

instance of CCM_Service_ResourceProfileInformation

{

    // File System Query Task - actual filesystem crawl for SINV/FILECOLL

    ProfileID = "{58E2FE09-07BB-4adb-8A93-E49C5BF2301F}";

    ControlUsage = true;

    BatchSize = 100;

    OnAC_PercentageOfTimeoutToWait = 50;

    OnAC_EvaluationPeriodLengthSec = 60;

    OnAC_IdlePeriodLengthSec = 120;

    OnAC_MinIdleDiskPercentage = 30;

    OnAC_ConsiderUserInputAsActivity = true;

    OnBattery_BehaviorType = 1;

    OnLowBattery_BehaviorType = 0;

};

 

 

Where to find the task profiles:

Each task profile can be found in the default client policy and the class "CCM_Service_ResourceProfileInformation".

The default SINV profile policies will be imported during ConfigMgr Client installation and they are not part of the policies from your Site.

 

Default class location:

ROOT\ccm\Policy\DefaultMachine\RequestedConfig:CCM_Service_ResourceProfileInformation

 

Actual settings location:

ROOT\ccm\Policy\Machine\ActualConfig:CCM_Service_ResourceProfileInformation

 

 

What all those settings mean:

I did several tests with each setting and ask several colleagues but wasn't able to find a clear description of each setting. So, the list is the result of my testing process and might not be 100% accurate. Please keep that in mind if you want to try out some settings for yourself.

 

 Setting

Description

ControlUsage = true

True = throttling active

False = throttling disabled

That's what you normally find online as a solution to speed up slow software inventory processing. But without throttling, the user might experience a terribly slow machine.
 

BatchSize = 100

Size of operations per Interaction.

Does not seem to have an effect if the disk is not idle and throttling is active.

 

OnAC_PercentageOfTimeoutToWait = 50

From what I saw during my tests it looks like this value is the percentage of the overall timeout per task. If the percentage is reached, the system seems to check if throttling is still need or needs to be applied.

 

In the InventoryAgent.log you see entries similar to this:

Timeout for: C0ED66AD-8194-49fd-9826-D0DD38AB7DAA = 7200 sec
Timeout for: 58E2FE09-07BB-4adb-8A93-E49C5BF2301F = 1440 sec 

 

So, 50% of 7200 seconds is 3600 seconds after which the throttling would be evaluated again. But I am not 100% sure about that.
 

OnAC_IdlePeriodLengthSec = 120

Seconds the disk needs to be at 30% usage  before throttling will be cancelled and SINV runs at full speed again.
The 30% value comes from the „OnAC_MinIdleDiskPercentage = 30“ setting. (See next row)

  

OnAC_MinIdleDiskPercentage = 30

See description in row above.

 

OnAC_ConsiderUserInputAsActivity = true

True means, if the user is working on the system software inventory should be throttled. If set to false user input will not be evaluated and software inventory will not be throttled based on that.

 

OnBattery_BehaviorType = 1

 

IMPORTANT:

This value needs to be the same for all three task profiles otherwise software inventory might not work.

I am not 100% sure, but it looks like a value of 1 means that the system will use the same throttling behavior if the system runs on battery as if it would be running on AC.

 

OnLowBattery_BehaviorType = 0

 

IMPORTANT:

This value needs to be the same for all three task profiles otherwise software inventory might not work.

I am not 100% sure, but it looks like a value of 0 means that the system will not scan at all on low battery.

 

Settings without values

There are more settings in each task profile, but those are not set, and I haven't tested anything with them.

 

List of settings without values:

OnBattery_ConsiderUserInputAsActivity

OnBattery_EvaluationPeriodLengthSec

OnBattery_IdlePeriodLengthSec

OnBattery_MinIdleDiskPercentage

OnBattery_PercentageOfTimeoutToWait

OnLowBattery_BehaviorType

OnLowBattery_ConsiderUserInputAsActivity

OnLowBattery_EvaluationPeriodLengthSec

OnLowBattery_IdlePeriodLengthSec

OnLowBattery_MinIdleDiskPercentage

OnLowBattery_PercentageOfTimeoutToWait

 

Test setup:

After several tests I found the task: „File System Query Task - actual filesystem crawl for SINV/FILECOLL“ with ProfileID "{58E2FE09-07BB-4adb-8A93-E49C5BF2301F}" to be the one with the most impact on overall speed and focused my testing on that task.

My goal was to find the most promising values to get an idea how to use those in a production environment.

 

I created two folders, one with 50 and one with 180 exe files in it and used those in my software inventory client setting.
(But you might need much more files and folders to see an effect during you tests. Ideally use a system with slow SINV processing described in section “How to find the correct values for your environment”.

 

I then changed different values for that profile and tested how long the scan process takes. Since I was only testing with such small number of files, I did not saw any decrease on machine performance, but If you like to test that for yourself, you might need to monitor system performance to avoid slowing the system down.
Since that's the whole point of throttling, to keep the system as performant as possible to not annoy the user working on that machine during a SINV scan. 

 

Values I used and test results:

(See description of settings in list above)

 

Setting

Overall

scan time

Description

Default (no changes)

~500-600 seconds

Both folders were scanned in about 500-600 seconds. The folder with just 50 files was scanned in just 3 seconds and the rest of the time was used for the second folder with 180 files.

The overall time can be even longer if DiskUsage is above the threshold (see table above) and throttling is used more often.

 

ControlUsage = false

~4 seconds

With throttling disabled both folders have been scanned in around 4 seconds.

Which is nice, but the machine might be not as responsive as the user working with it would like it to be.

 

BatchSize = 200

(default = 100)

~4 seconds

Both folders were scanned in about 4 seconds and the reason seems to be the lower file count than the batch size of 200.

Software inventory will keep the throttling (on or off) for each batch. So

 

The overall time can be much longer if DiskUsage is above the threshold (see table above).

 

OnAC_ConsiderUserInputAsActivity = FALSE

(default = true)

~200 seconds

If user input is ignored, the scan will still be throttled, but it is much faster than with the default settings.

 

The overall time can be much longer if DiskUsage is above the threshold (see table above).

 

OnAC_ConsiderUserInputAsActivity = FALSE

(default = true)

OnAC_PercentageOfTimeoutToWait = 4

(default = 50)

 

~65 seconds

If user input is ignored and the percentage of the timeout is set to a small value, the overall process is much faster.,

 

The overall time can be much longer if DiskUsage is above the threshold (see table above).

 

OnAC_IdlePeriodLengthSec = 100

(default = 120)

~6 - 300 seconds

 

If we decrease the IdlePeriodLengthSec and let the DiskUsage be checked more frequently, the overall speed can be vary between 6 and 300 seconds depending on the actual DiskUsage value at the moment of measurement.

 

 

How to find the correct values for your environment:

Before changing any setting described above, you should definitely review your client settings and all the paths you set for SINV. Because I have seen how several customers have scanned paths that are not needed or the collected data was not used at all. So, disabling SINV or a simple exclusion of some path can be enough.

For example, if you are scanning a path for a well-known managed application, you might have data about the app already, either via hardware inventory or via application deployment status and another dataset via SINV might not be needed.

Simply place a file called: “Skpswi.dat” (with no content in it) in the folder you want to exclude.

 

You should also check all systems with missing or old SINV data for errors before changing the throttling profiles and maybe making things worse.

Use the following collection query to find systems with old (30 days) or no SINV data for further analysis:

select SMS_R_SYSTEM.ResourceID, SMS_R_SYSTEM.ResourceType, SMS_R_SYSTEM.Name, SMS_R_SYSTEM.SMSUniqueIdentifier,SMS_R_SYSTEM.ResourceDomainORWorkgroup, SMS_R_SYSTEM.Client from SMS_R_System where SMS_R_SYSTEM.ResourceID not in (select SMS_G_System_LastSoftwareScan.ResourceID from SMS_G_System_LastSoftwareScan where SMS_G_System_LastSoftwareScan.LastScanDate >=  DateAdd(dd,-30,GetDate()))

 

If you still need to speed up the SINV process, you should pick some systems you can test on (ideally from the collection query above) and test with the following settings by using the "Set-SINVThrottlingPolicy.ps1" script you will find in the repository below.

  • OnAC_ConsiderUserInputAsActivity
  • OnAC_PercentageOfTimeoutToWait
  • OnAC_IdlePeriodLengthSec

 

Test different values for the settings to find the optimal configuration and to find a good balance between speed and usability of the system so that you receive no complaints about system performance during SINV scans from your end users.

 

PowerShell to the help:

The following repository: LINK contains five files to help you with testing and to implement the solution as a ConfigMgr baseline if you like.

 

IMPORTANT: The provided values in the script might not be the best choice for your environment and are only meant as an example!

 

File #1: Set-SINVThrottlingPolicy.ps1

The script is intended to run as part of a ConfigMgr compliance setting and is designed as a detection or remediation script depending on the value of the “$Remediate” variable.

 

For testing purposes simply run the script locally on the system in PowerShell ISE opened as an admin.

You only need to adjust the following section to your needs:

#region variables

[bool]$Remediate = $false

#endregion

#region CUSTOM Settings Profile {58E2FE09-07BB-4adb-8A93-E49C5BF2301F} for file system query task - actual filesystem crawl for SINV/FILECOLL

# Custom settings

[hashtable]$SINVCUSTOMProfileSettings = [ordered]@{

    BatchSize = 100;

    OnAC_PercentageOfTimeoutToWait = 10;

    OnAC_EvaluationPeriodLengthSec = 20;

    OnAC_IdlePeriodLengthSec = 30;

    OnAC_MinIdleDiskPercentage = 30;

    OnAC_ConsiderUserInputAsActivity = $false;

    }

#endregion

 

Change the values of $SINVCUSTOMProfileSettings to the values you prefer (see description in section: “Values I used and test results”) and set the $remediate variable as needed.

 

$Remediate = $false

The script will not set the custom policy and will simply output true or false if the desired settings are set or not. (can be used as detection script in a ConfigMgr compliance item)

 

$Remediate = $true

The script will set the custom policy if it does not exist or will change the values an existing policy to what you have defined in $SINVCUSTOMProfileSettings.

(can be used as remediation script in a ConfigMgr compliance item)

 

File #2: Delete-SINVThrottlingPolicy.ps1

The script will either detect the custom SINV policy or delete the policy depending on the value of the variable $Remediate and the script is also designed to run as a ConfigMgr compliance item.

 

File #3: CI-SetSINVThrottlingPolicy.cab

File #4: CI-DeleteSINVThrottlingPolicy.cab

Both files contain one compliance item which can be imported into ConfigMgr and which then can be used in a compliance baseline to check, set or delete the policy on multiple machines.

They contain the scripts described above.

 

File #5: SINV-Throttling-Profile.filterset

One of my favorite troubleshooting tools is the: "Support Center for Configuration Manager" which is part of the ConfigMgr installation since version 1810.

The documentation can be found here: LINK

I added a "filterset" file: “SINV-Throttling-Profile.filterset” to the repository which can be imported into "Support Center Log File Viewer", to then filter SINV related events and to make testing the throttling settings much easier.

 

Open "InventoryAgent.log", "FileSystemFile.log" and “PolicyAgentProvider.log

at once with "Support Center Log File Viewer" and import the filterset file in the “Advanced filter” menu via “Load filters”. You are now able to validate the changes made by the script above by triggering software inventory from the ConfigMgr client applet.

 

Any change on the policy with the script or via the configuration items should be visible in “PolicyAgentProvider.log” with the following log entry:

--- [1] __InstanceModificationEvent settings change on object CCM_Service_ResourceProfileInformation.ProfileID="{58E2FE09-07BB-4adb-8A93-E49C5BF2301F}".

 

Conclusion:

It is possible to speed up the SINV process in ConfigMgr without disabling SINV throttling completely but cleaning up the SINV client settings should be the first priority.

Good testing with the tools I provided is also a necessary step to not make the problem worse.

 

Have fun with the solution and let me know what you think about it.

 

Best regards

Jonas Ohmsen

Microsoft Germany

 

 

Disclaimer:

The sample scripts are not supported under any Microsoft standard support program or service. The sample scripts are provided AS IS without warranty of any kind. Microsoft further disclaims all implied warranties including, without limitation, any implied warranties of merchantability or of fitness for a particular purpose. The entire risk arising out of the use or performance of the sample scripts and documentation remains with you. In no event shall Microsoft, its authors, or anyone else involved in the creation, production, or delivery of the scripts be liable for any damages whatsoever (including, without limitation, damages for loss of business profits, business interruption, loss of business information, or other pecuniary loss) arising out of the use of or inability to use the sample scripts or documentation, even if Microsoft has been advised of the possibility of such damages.

 

Resources:

Download the whole solution or clone the repository here:
https://github.com/jonasatgit/scriptrepo/tree/master/SINV

 

Support Center for Configuration Manager:
https://docs.microsoft.com/en-us/mem/configmgr/core/support/support-center

 

Updated Sep 07, 2020
Version 3.0
No CommentsBe the first to comment