I have Windows 7 PCs that have automatic update turned off. I do updates in batch once a month or so. But each time "check for update" takes 15 to 30 minutes. I don't understand why checking for updates can be so slow? I have to wonder what is happening in the background. Is it computing hash? Are my PCs with automatic updates enabled suffer the same fate every time it boots up (only that I wasn't aware)?
Windows 7 uses Component-Based Servicing, which means Windows Update has to work ridiculously hard to determine file and component dependencies/inter-dependencies, maintain side-by-side versions of older files/components, while still making it possible to uninstall individual updates/components but without breaking any other updates/components, all the while taking into account supercedence and god knows what else. The code that does all this must be hellishly complex.
The code behind Windows Update is highly inefficient, probably due to its conceptual complexity. My observations over the last few years are that, as the total number of released updates has increased, update check time has increased in an almost exponential way. To me that's indicative of some kind of recursive algorithms being employed, perhaps to determine superscedence or resolve dependencies.
Update Revisions: When changes are made to a previously released update, it's called an Update Revision, where some pieces of the download are changed. This is a partial, not full, update replacement.
Superseded Updates: This is a complete replacement of a previous release, or releases. Sometimes Microsoft will wrap multiple releases into a single package, and that package replaces its encapsulated updates.
Expired Updates: These are updates removed from the list of valid updates. Such updates are no longer applicable and will not be detected for installation. Most times, an update is expired after it is replaced by a Superseded Update.
Expired Updates are problematic to WU performance, since unfortunately they are not removed from the computer, so they still take part in the calculations,and there are so many of them.Some improvement may be achieved by using Disk Cleanup to Remove Outdated Windows Updates(take first a backup disk image of the system drive, since WU is also very fragile).
Because of the enormous number of possible combinations, Microsoft keeps all updates on the WU servers in the format of a humongous tree.Deciding on which updates need to be applied is done by a tree-pruning algorithm, which takes into account the client's installed hardware and software,as well as all the updates that are already installed, which is by itselfa large body of facts that need all be applied successfully when pruning.
The algorithm is not guaranteed to succeed, meaning that WU is perfectlycapable of destroying the OS or even rendering it unbootable.This is entirely understandable, for example taking an update A1, having revision A2, where an update B depending on A was released between A1 and A2.Now go figure whether the order of installation should be A1-B-A2 or A1-A2-B, when the wrong decision can be deadly.
As of 2008, Windows Update had about 500 million clients, processed about 350 million unique scans per day, and maintained an average of 1.5 million simultaneous connections to client machines. On Patch Tuesday, the day Microsoft typically releases new software updates, outbound traffic could exceed 500 gigabits per second.
These numbers have probably doubled by now, and explain why the WU serversare sometimes unreachable.I am using the WU option of "Check for updates but let me choose", andmy own experience is that there are days and times when checking for updatestakes longer than I'm willing to wait, requiring postponement.
The good side of a Service Pack is that installing it wipes out the entireupdate history, so that in effect WU starts from zero, exactly as aftera fresh installation of Windows. This of course speeds up enormouslyall the calculations, since there are fewer updates to take into account.
The sheer number of existing updates since SP1 explains why WU calculations are so slow today. For Microsoft the problem can be solved"simply" by upgrading to the more recent Windows 8.1 or Windows 10, so WUwill have a smaller number of updates to take into account.
Most updates also apply to Windows 8 and 10,so the burden on Microsoft's WU servers will only multiply when Windows 10is soon released. Microsoft also seems to parcel the bandwidth of its WU serversaccording to its own policies, with the accent on serving the more recentoperating systems, so we should expect another slow-down for Windows 7once Windows 10 is released, together with disproportionately faster updatesfor Windows 10.
Restart the PC and disconnect from internet before Windows loads, this is important because at every boot windows will check for updates in the background and this will start the checking for updates hang all over again and will prevent the install of the downloaded packages until it finishes checking, so disconnecting from the internet before Windows loads prevents this.
Now install the SUR Tool package, this is a big package and will install many updates along with cleaning up and repairing the Windows update store. It will also cut down on how many more Windows updates will need to be installed later.
After install of SUR package reboot, connect to internet and do a manual Windows Update, it should work much faster now. Even after these fixes I have seen some W7 PC's take up to an hour to finish checking for updates if launched from Control Panel manually.
If you have other Windows updates issues and the 2 updates above are installed, download this Microsoft Windows Update fixit tool (right click "save link as") run it and select aggressive mode to completely reset Windows updates. Reboot and try Windows Updates from the Control Panel again. This tool fixes issues when the other Microsoft fixit tools fail, at least in my experience.
Update: Microsoft has released a huge update rollup for Windows 7 SP1, this is similar to a service pack but they are not calling it that. This will make it Much faster to update Windows 7 after a clean install, no more Windows update issues and many reboots. This update rollup will bring the system current to patch Tuesday of April 2016.
Also use the Windows Update Catalog page to download and install this update first, 3020369, it is a pre-requisite for the rollup, then install 3125574, also be sure to be disconnected from the internet when applying these updates.
When you use ETW/WPR/WPA to check for the CPU usage during the scan you see that the CPU usage comes from wuaueng.dll!CUpdatesToPruneList::AddSupersedenceInfoIfNeeded which is called from wuaueng.dll!CAgentUpdateManager::FindUpdates. The AddSupersedenceInfoIfNeeded method is the slowest thing. This does what the name indicates and looks if the offered/installed Windows 7 updates are still needed or superseded (outdated/replaced by newer ones). This is very slow.
In Windows 10 Microsoft fixed the issue by following my suggestion and make the updates cumulative. Here you only need 1 large update to be at the current patch level. This slow checking is no longer needed.
If past experiences with the XP update are any indication, they occasionally let slip an exponential-time algorithm in there. Which once you have many updates... takes forever. Currently the Win 7 updates are in a similar situation; take a long time, although there's no official explanation for this latest bout of slowness yet. It's interesting that this "just happens" (to the old versions) when they have a new one out. The cynical me can't help but imagine that someone might intentionally want that to happen, along the lines of [old] Windows is slow? You need a new version. Or maybe it's just the MS way of starting the holiday season.
There is a hotfix for some kind of WU slowness, which is not being offered automatically (i.e. via update itself): -us/kb/3102810 Alas it did not make a real difference in my case, and I've tried it on two different computers one 32-bit and one 64-bit. Also it has been around since October, so it's probably not for the latest issue[s].
There are about a billion PCs running Windows today. Each PC has some combination of hardware, accessories, OS version, language, IE, device driver version, Microsoft software at various patch levels, security updates, etc. The Windows Update system has to sort through all these combinations to offer the right updates for an individual PC. Each update has properties including dependencies and a "supercedence" structure.
The first step (first run) in the scan is to determine the OS version, SP, language, PC manufacturer to prune the tree of likely updates for the PC. Based on that first scan, a likely set of update IDs are sent to the device and the local client computes which updates are installed, superseded, etc. and then sends that list to the server and also caches a copy locally for subsequent scans. The server responds to the client request for updates with descriptions, etc. that are displayed in the UI (in the appropriate UI language).
Once a day, a check update is done by the Automatic Updates client in the background and refreshes the local cache of installed updates, so that subsequent scans are just a delta and fast. These are stored in the %windir%\softwaredistribution folder on the PC.
Your best bet in my opinion is to just enable windows updates and switch to the option which lets you download updates but not install automatically. That way, you can get what you want installed without having to wait for checks or background file downloads.
Now, to answer why it's slow. I think it simply comes down to the fact that windows updates was built with the reduction of noticeable impact to users in mind. It uses the BITS service (background intelligent transfer service) to check for and download updates.
c80f0f1006