none
Server Cleanup Wizard hangs . . . .

    Question

  • I have seen several references to the Server Cleanup Wizard hanging on the first option (remove unused updates).  This was happening to me.  I found the following in one of the threads here and pass 1 works for me but when I try pass 2 by selecting only the option "remove unused updates" it still seems to hang.  Unless I am not being patient enough but I have let it run for hours and see no progress.  Any ideas?  Is there a log I can ceck to see if it s progressing?  I have seen this on both servers with SQL 2005 an also Servers with SQL Express.  These servers are SCCM servers so some are Primary sites with SQL and some are secondary Sites (no SQL - so we use SQL express).  any ideas?

    "Restart ONLY the Update Services service. Attempt the Server Cleanup Wizard again. Run it in two passes. Pass 1 performing everything except  remove unused updates. Pass 2 running only remove unused updates."

    Thursday, July 30, 2009 7:36 PM

Answers

  • > I have seen several references to the Server Cleanup Wizard hanging on the first option (remove unused updates).  This was happening to me.

    It's not at all inconceivable that it might take some time to run the Server Cleanup Wizard on a machine that's never used this utility before. Consider these various issues that would impact the responsiveness of the WSUS database:

    1. Number of active clients executing detections against the WSUS front-end.
    2. Update downloads consuming disk i/o resources.
    3. Any and all activities of SCCM running concurrently.
    4. SCCM is *sharing* <???> the database (SQL Express???) with WSUS.
    5. Number of updates contained in the catalog.
    6. Number of computers reported to the server.
    7. Diversity of OS platforms of clients and applications installed.

    All of which impacts the time and efficiency necessary for the SCW to execute a scan against the entire catalog of updates, each update requiring a scan against every computer listed to determine if the update has been Needed in the past 30 days.

    Truly, I don't know the source of the above boldfaced recommendation, but I'd actually split the run into more than two passes if it's the first time being run on a WSUS server that's been active for more than a couple of months....

    Pass 1: Run option #2 to delete all computers not contacting the server. (No need to have the update scans comparing against computers that are irrelevant.)

    Pass 2: Run options #4 and #5 to decline all expired and superceded updates that are no longer needed.

    Pass 3: Run option #1 to delete *updates* that are expired or have unneeded revisions.

    Pass 4: Run option #3 to delete the update files from the filesystem that are not needed.

    Furthemore, a somewhat inconvenient reality is that the SCW can only be run interactively, but *during the workday* is probably the worst time to run these utilities. I would suggest starting each Pass at the end of the workday and let it run overnight.

    Lawrence Garvin, M.S., MCITP:EA, MCDBA
    Principal/CTO, Onsite Technology Solutions, Houston, Texas
    Microsoft MVP - Software Distribution (2005-2009)
    Friday, July 31, 2009 1:59 AM
    Moderator
  • > So I suspect the massive number of definition updates that get published is probably the reason.

    Absolutely. On a machine providing Defender or Forefront updates, particularly those with auto-approval rules (which causes significant downloads of several updates per day), I'd suggest that the SCW should be run at least MONTHLY on such systems and maybe even WEEKLY if the WSUS Server contains a large number of client systems.

    If nothing else, those Defender/Forefront updates can chew up a lot of disk space, not including the database space used once they're superceded a few hours later.

    btw.. as to the 'feature' of being able to schedule the Server Cleanup Wizard, and particularly as relates to your large number of WSUS servers -- you might find this third-party product: Extension Pack for WSUS of some interest and benefit.

    > I turned off option 1 in the script as a test on a server and that worked great, but ultimately would like to be able to run that option on all servers. 

    Also, running this option is critical to the success of Option #3 with respect to removing the content from expired/revised updates where the current revision is still approved. The key here, ultimately, I believe -- particularly on highly-volatile servers with a large number of clients -- will be to run Option #1 much more frequently -- perhaps even weekly. Once you get the initial cleanup completed, though, subsequent weekly/monthly cleanups should take significantly less time.

    >  For the server where I let the wizard run overnight and it was progressing very slowly, it never finished.  It lost its connection in the console somewhere during the night

    If this server is performing backups, including the WSUS database, this could account for the broken connection; system restarts could also do this.
    Also, be sure to run the wizard from the LOCAL console, not from a REMOTE console.
    Lawrence Garvin, M.S., MCITP:EA, MCDBA
    Principal/CTO, Onsite Technology Solutions, Houston, Texas
    Microsoft MVP - Software Distribution (2005-2009)
    Thursday, August 06, 2009 5:03 PM
    Moderator

All replies

  • > I have seen several references to the Server Cleanup Wizard hanging on the first option (remove unused updates).  This was happening to me.

    It's not at all inconceivable that it might take some time to run the Server Cleanup Wizard on a machine that's never used this utility before. Consider these various issues that would impact the responsiveness of the WSUS database:

    1. Number of active clients executing detections against the WSUS front-end.
    2. Update downloads consuming disk i/o resources.
    3. Any and all activities of SCCM running concurrently.
    4. SCCM is *sharing* <???> the database (SQL Express???) with WSUS.
    5. Number of updates contained in the catalog.
    6. Number of computers reported to the server.
    7. Diversity of OS platforms of clients and applications installed.

    All of which impacts the time and efficiency necessary for the SCW to execute a scan against the entire catalog of updates, each update requiring a scan against every computer listed to determine if the update has been Needed in the past 30 days.

    Truly, I don't know the source of the above boldfaced recommendation, but I'd actually split the run into more than two passes if it's the first time being run on a WSUS server that's been active for more than a couple of months....

    Pass 1: Run option #2 to delete all computers not contacting the server. (No need to have the update scans comparing against computers that are irrelevant.)

    Pass 2: Run options #4 and #5 to decline all expired and superceded updates that are no longer needed.

    Pass 3: Run option #1 to delete *updates* that are expired or have unneeded revisions.

    Pass 4: Run option #3 to delete the update files from the filesystem that are not needed.

    Furthemore, a somewhat inconvenient reality is that the SCW can only be run interactively, but *during the workday* is probably the worst time to run these utilities. I would suggest starting each Pass at the end of the workday and let it run overnight.

    Lawrence Garvin, M.S., MCITP:EA, MCDBA
    Principal/CTO, Onsite Technology Solutions, Houston, Texas
    Microsoft MVP - Software Distribution (2005-2009)
    Friday, July 31, 2009 1:59 AM
    Moderator
  • Thank you for the reply.  I have successfully run options 2,3,4,5 already.  The only one that seems to hang is #1 to delete *updates* that are expired or have unneeded revisions.  I have run it on the weekend on a server with a handful of clients and let it go for hours.  I have run it on busier servers with more clients as well.  I have also run it on SCCM Primary Sites that do have SQL Server as opposed to SQL express.  All appear to behave identically. I can easily get through all the options except #1.  All the other options complete within minutes even the first time it is run on a server.  Is there a log I can look at or something to show whether it is actually doing anything when it "appears" to be hung?
    Tuesday, August 04, 2009 10:06 AM
  • The individual tasks generated by the SCW are logged to the SoftwareDistribution.LOG.
    Lawrence Garvin, M.S., MCITP:EA, MCDBA
    Principal/CTO, Onsite Technology Solutions, Houston, Texas
    Microsoft MVP - Software Distribution (2005-2009)
    Tuesday, August 04, 2009 1:50 PM
    Moderator
  • Interesting, I would usually give it about 2 hours and give up assuming it is hung.  I decided to let it go and can see that the progress bar is actually moving although extremely slowly.  I would estimate option 1 is 25% done but has been running about 6 hours.  I will leave it overnight and see if it ever finishes. 
    Tuesday, August 04, 2009 9:10 PM
  • Just for comparison.... I ran option #1 on my server today -- SCW hasn't been run since April -- and it took a few hours to complete, so only a few months of non-maintenance can quickly become problematic.


    Lawrence Garvin, M.S., MCITP:EA, MCDBA
    Principal/CTO, Onsite Technology Solutions, Houston, Texas
    Microsoft MVP - Software Distribution (2005-2009)
    Tuesday, August 04, 2009 9:59 PM
    Moderator
  • We typically don't run WSUS natively.  It is on our 250+ SCCM boxes for Software Updates.  But whre we do use WSUS natively is fo Forefront Definiton updates since there is really know way to handle that with SCCM today. So I suspect the massive number of definition updates that get published is probably the reason. Managing clenup on 250+ servers would be a nightmare.  I did find a powershell script on the WSUS site to do it and it works well but thats when I ran into this issue with option 1 taking forever. I turned off option 1 in the script as a test on a server and that worked great, but ultimately would like to be able to run that option on all servers.  For the server where I let the wizard run overnight and it was progressing very slowly, it never finished.  It lost its connection in the console somewhere during the night.
    Thursday, August 06, 2009 3:07 PM
  • > So I suspect the massive number of definition updates that get published is probably the reason.

    Absolutely. On a machine providing Defender or Forefront updates, particularly those with auto-approval rules (which causes significant downloads of several updates per day), I'd suggest that the SCW should be run at least MONTHLY on such systems and maybe even WEEKLY if the WSUS Server contains a large number of client systems.

    If nothing else, those Defender/Forefront updates can chew up a lot of disk space, not including the database space used once they're superceded a few hours later.

    btw.. as to the 'feature' of being able to schedule the Server Cleanup Wizard, and particularly as relates to your large number of WSUS servers -- you might find this third-party product: Extension Pack for WSUS of some interest and benefit.

    > I turned off option 1 in the script as a test on a server and that worked great, but ultimately would like to be able to run that option on all servers. 

    Also, running this option is critical to the success of Option #3 with respect to removing the content from expired/revised updates where the current revision is still approved. The key here, ultimately, I believe -- particularly on highly-volatile servers with a large number of clients -- will be to run Option #1 much more frequently -- perhaps even weekly. Once you get the initial cleanup completed, though, subsequent weekly/monthly cleanups should take significantly less time.

    >  For the server where I let the wizard run overnight and it was progressing very slowly, it never finished.  It lost its connection in the console somewhere during the night

    If this server is performing backups, including the WSUS database, this could account for the broken connection; system restarts could also do this.
    Also, be sure to run the wizard from the LOCAL console, not from a REMOTE console.
    Lawrence Garvin, M.S., MCITP:EA, MCDBA
    Principal/CTO, Onsite Technology Solutions, Houston, Texas
    Microsoft MVP - Software Distribution (2005-2009)
    Thursday, August 06, 2009 5:03 PM
    Moderator
  • This issue has been plaguing a lot of people.  The answer "You have too many updates" is not an answer.  Digging in to find out the real problem, now that's an answer!  At this point, I have two WSUS servers at two locations that have been running for eight days before they finished cleanup.  They have over 9000 files an 100GB at each site.  However, cleanup doesn't delete anything.  So I have tried a wsusutil reset.  That has been running for 5 days now without any indication that it is going to complete.

    I started digging in to find why this is happening.  It appears that the problem stems from SQL.  The sqlserver.exe process runs at 100% CPU with little to no bytes of disk movement.  That usually indicates a poorly performing index.  So I pulled up the worst performing queries, and found the following query keeps coming up as taking all the CPU.  I'm looking to see if I can't find an index that will make this run at the intended speed.  If we can find the answer to this, it will help WSUS to run through a reset in a few minutes instead of an entire week:

    UPDATE tbDeployment SET DeploymentStatus = 0 FROM tbDeployment
        INNER JOIN tbRevision ON tbRevision.RevisionID = tbDeployment.RevisionID
        WHERE tbRevision.RowID = @rowID AND tbDeployment.ActionID = 0
            AND tbDeployment.DeploymentStatus = 1 AND tbDeployment.UpdateType NOT IN ('Category', 'Detectoid')


    • Edited by Brain2000 Wednesday, March 13, 2013 8:08 PM
    Wednesday, March 13, 2013 8:03 PM
  • Brain2000: That's interesting.

    Did you also try to run the following and check out your application event logs:

    wsusutil.exe checkhealth

    I had very slow SQL performance, and the above revealed a few problems that I troubleshot and was able to regain performance.

    I think anyone running WSUS now has about the same amount of stuff.

    Post back if you have some luck.

    Thanks,

    Matt

    Wednesday, March 13, 2013 9:14 PM
  • Brain2000: That's interesting.

    I'm intrigued with his case study as well, and I've commented on it in an earlier thread, but what isn't mentioned here is that Brain2000 has a WSUS server with 9000+ updates synchronized and over 100GB of downloaded content (indicating an excessive number of approved updates), and that's certainly impacting the performance of his Server Cleanup Wizard when running in the native schema.

    Still pending an answer in that thread is whether this particular server has ever executed the WSUS DB Maintenance script to reindex and recalculate stats.


    Lawrence Garvin, M.S., MCITP:EA, MCDBA, MCSA
    SolarWinds Head Geek
    Microsoft MVP - Software Packaging, Deployment & Servicing (2005-2013)
    My MVP Profile: http://mvp.support.microsoft.com/profile/Lawrence.Garvin
    http://www.solarwinds.com/gotmicrosoft
    The views expressed on this post are mine and do not necessarily reflect the views of SolarWinds.

    Wednesday, May 29, 2013 3:16 AM
    Moderator