How Long Does WAM Take to Clean WSUS?

by | Last updated 2024.03.09 | Published on 2019.04.10 | Blog

On most new systems, WAM can clean WSUS in under 72 hours; however, older systems with slower processing power could take longer.

Older hardware—especially systems between 2010 and 2012—can slow down when it comes to removing obsolete updates. While many systems will clear this step in minutes or just a few hours, some systems require days. The benefit of WAM is that you can let the software run in the background, there’s no input needed by the user.

If you’re concerned about the amount of the time WAM is taking to clean WSUS, you can check the progress using SQL Server Management Studio and connecting to the Windows Internal Database (WID).

Once connected, open a new query window and paste in the following code:

USE SUSDB
EXEC spGetObsoleteUpdatesToCleanup

This will return the number of rows left to process. Make note of that number and re-run again in an hour. The second run should return fewer rows to be processed. Subtract the two numbers to find out how many records per hour WAM is processing. From this, you can gauge how long it’s going to take.

An alternative is to open an elevated PowerShell (Run as administrator) and run:

Invoke-SqlCmd -ServerInstance np:\\.\pipe\MICROSOFT##WID\tsql\query -Database SUSDB -Query 'CREATE TABLE #results (UpdatesToCleanUp INT); INSERT INTO #results(UpdatesToCleanUp) EXEC spGetObsoleteUpdatesToCleanup; SELECT Count(*) AS [UpdatesToCleanUp] FROM #results' -IncludeSqlUserErrors -Encrypt Optional

This will do the same thing, except give you only exactly what you’re looking for – the number of updates to clean up. Re-run this same query in an hour and subtract the second time from the first time to find out how many records per hour WAM is processing. From this you can gauge how long it’s going to take.

If you want to speed up the process, cancel the existing run, increase the Application Pool Memory, and then restart -FirstRun. You can also stop the WSUS Service to help increase speed.

To restart -FirstRun, open the WAM Shell (Windows Menu > Programs > AJ Tek > WAM Shell) and run:
.\Clean-WSUS.ps1 -FirstRun
To check what the current memory level is by running: *AS OF RELEASE 2021.07*
Get-ApplicationPoolMemory -Name WsusPool
If it is less than 4GB, set it to 4GB:
Set-ApplicationPoolMemory -Name WsusPool -NewMemoryValue 4096
If it is 4GB or more and less than 8GB, set it to 8GB:
Set-ApplicationPoolMemory -Name WsusPool -NewMemoryValue 8192
If it is 8GB or more and less than 12GB, set it to 12GB:
Set-ApplicationPoolMemory -Name WsusPool -NewMemoryValue 12288
If it is already 12GB or higher, set it to unlimited:
Set-ApplicationPoolMemory -Name WsusPool -NewMemoryValue 0
In most applications, WAM can clean WSUS in 2-72 hours; however, older and neglected systems can take days. It’s perfectly normal to have the software running for days. You don’t need to check on anything or stop the process. Just let WAM work in the background and wait for the WSUS Cleanup Results email.

WAM is available for online purchase. Your yearly subscription includes free support through the website and is payable by credit card or Bitcoin.

Purchase the preferred method of WSUS maintenance worldwide.

WSUS Automated Maintenance (WAM) © system was developed by AJ Tek and is used by system administrators worldwide—from Australia to Antarctica. With over 50,000 unique downloads, it’s the preferred method of WSUS maintenance worldwide.

Follow AJ Tek on Facebook and LinkedIn for
updates on new releases and products.

Latest Blogs

No Results Found

The page you requested could not be found. Try refining your search, or use the navigation above to locate the post.

How to Automate WSUS Maintenance

How to Automate WSUS Maintenance

How much time do you spend on WSUS maintenance? Do you put it off because of the time it requires, or do you just dread the monotonous tasks of going through updates? Do you even know that you need to do WSUS maintenance? Did you know that there is an easy way to...

How to Avoid WSUS Errors

How to Avoid WSUS Errors

As a system admin, it’s likely that you’ll run into WSUS errors and Windows Update client errors, as it’s just part of the job. The extremely frustrating part is that often, the error code is a maddening mix of letters and numbers: 0x8024401F 0x8024401c 0x8024402b...

How to Clean Up WSUS Database?

How to Clean Up WSUS Database?

If you’re running out of space in your WSUS database, you might decline updates and run the Cleanup Wizard; however, this Cleanup tool doesn’t actually clean the database, leading to sluggish and slow operations.  To easily clean up your WSUS database, there’s only...