Why is checking Windows Update so slow?

375,965

Solution 1

The checking for updates part is so slow because:

  • 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.

  • Windows 7 64-bit has to maintain both 32-bit and 64-bit versions of each update.

  • Windows has to maintain both GDR and LDR versions of each update, which means on Windows 7 64-bit you get 32-bit GDR, 32-bit LDR, 64-bit GDR, 64-bit LDR for each update.

  • 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.

Unfortunately for us, Microsoft don't like talking about Windows internals so we end up having to figure it out for ourselves or speculate.

Solution 2

Several facets of the problem were treated in the existing answers. I will try to tie them together by listing the causes in a general manner, without repeating what has already been said:

  1. Microsoft Windows Update mechanism is extremely sophisticated, which unfortunately also means complicated
  2. WU needs to support an incalculable number of hardware and software combinations
  3. WU needs to apply the updates in the correct order
  4. Windows 7 is an older system, and SP2 is overdue and will probably never arrive, which makes for very many updates
  5. The last years, Microsoft was under a great pressure to fix numerous security problems, which resulted in very many hectic fixes, then fixes of fixes and so on to the n'th generation
  6. Microsoft has not been able to optimize enough the update mechanism, which is in general an exponential algorithm, resulting in a brute-force algorithm which is rather slow.
  7. Microsoft's WU servers are sometimes over-burdened.

Let us look at these points more in detail.

Windows Update complexities

After an update is released, it can enter into three additional different phases over time: Revisions, Supersedence, and Expiration.

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.

Updates have also a dependency mechanism, which means that some updates may require other updates to be applied first.

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).

WU Calculations

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 itself a large body of facts that need all be applied successfully when pruning.

The algorithm is not guaranteed to succeed, meaning that WU is perfectly capable 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.

Overburdened WU servers

Wikipedia has this to say about Windows Update statistics :

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 servers are sometimes unreachable. I am using the WU option of "Check for updates but let me choose", and my own experience is that there are days and times when checking for updates takes longer than I'm willing to wait, requiring postponement.

The long history of Windows 7

Windows 7 was released on July 22, 2009. After about 17 months, Service Pack 1 (SP1) came out on February 22, 2011. This was about 4.5 years ago, which means that SP2 is long overdue.

The good side of a Service Pack is that installing it wipes out the entire update history, so that in effect WU starts from zero, exactly as after a fresh installation of Windows. This of course speeds up enormously all 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 WU will have a smaller number of updates to take into account.

Conclusion

As Microsoft still continues to apply numerous updates to Windows 7, WU will only keep on slowing down as time passes.

One possible optimization is to Remove Outdated Windows Updates. Another is to use the WU option of "Check for updates but let me choose", and check for updates early morning or late at night.

Most updates also apply to Windows 8 and 10, so the burden on Microsoft's WU servers will only multiply when Windows 10 is soon released. Microsoft also seems to parcel the bandwidth of its WU servers according to its own policies, with the accent on serving the more recent operating systems, so we should expect another slow-down for Windows 7 once Windows 10 is released, together with disproportionately faster updates for Windows 10.

If WU is too slow, the only real solution is to upgrade to a later version of Windows.

Good news : SP2 for Windows 7 (and 8.1) has arrived

Microsoft has published what is actually SP2 for Windows 7 and 8.1. This update will not be available from Windows Update for some unknown reason, so has to be manually downloaded and installed.

Read about how to get it in the article :
Microsoft overhauls Windows 7 and 8.1 updating -- but don't call it a service pack.

Solution 3

This issue has come and gone over the years with different fixes along the way, so here is my updated guide to this issue as of this date January 5th, 2016

Check the EDIT section below, there is a much faster way to fully update Windows 7 SP1 after a clean install as of May 2016.

This is what I do when I reinstall W7 with SP1 or have issues with Windows update stuck on checking for updates.

If Service Pack 1 is not installed, install it before following this guide.

Download KB-3138612 and save it where you can find it later

Download SUR Tool save it to same place

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.

Once booted install KB-3138612, if reboot is required do so and stay disconnected from internet.

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.

This is not being released through Windows Update, you have to use Internet Explorer to get it, open IE and go to this address

http://catalog.update.microsoft.com/v7/site/home.aspx

Type in the search box 3125574 and hit enter key.

enter image description here

Now you will see all versions of this rollup, select the one you need and download it somewhere you can find it later.

enter image description here

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.

Solution 4

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.

With the last Windows Update Client update from June 2016, which is part of the Windows 7 July 2016 Update Rollup, the update search is fast again.

  1. Download:

Takes only a bit over 1 minute for me to search for new updates. To speedup the setup up of the update KB3172605, stop the WindowsUpdate service (net stop wuauserv).

This WU service stop trick speeds up install a lot, when you install several MSU updates:

@ECHO OFF
SETLOCAL ENABLEEXTENSIONS ENABLEDELAYEDEXPANSION
FOR /R "%~dp0" %%A IN (*Windows6.1-KB*.MSU) DO (
        CALL :SUB %%~nA        
    ECHO= Installing KB!KB_NUM!        
    >NUL net stop wuauserv
    WUSA "%%A" /quiet /norestart)
ECHO= == Press any key to close the Window ==
>NUL PAUSE

GOTO :EOF

:SUB

SET "KB_NUM=%*"
FOR /F "DELIMS=-" %%B IN ("%KB_NUM:*-KB=%") DO SET "KB_NUM=%%B"

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.

Solution 5

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): https://support.microsoft.com/en-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].

Share:
375,965

Related videos on Youtube

some user
Author by

some user

Updated on September 18, 2022

Comments

  • some user
    some user almost 2 years

    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)?

    • vembutech
      vembutech over 9 years
      It seems like background application are running. How did your system performance?
    • some user
      some user over 9 years
      My PC performs fine. CPU hardly went over 10%. I didn't notice anything unusual while it is "searching for updates".
    • gronostaj
      gronostaj about 9 years
      Why are you disabling Windows Update in the first place? It could run in the background and you wouldn't even notice until it asks you to reboot, which you don't have to do immediately.
    • some user
      some user about 9 years
      I like to update in batch so I can rollback if something went wrong. Background updates are hard to track and time consuming to rollback. And with manual update, I also have the option to review the changes before proceed. Also, once in a while I help people to clean install their PC and I am faced with the same problem.
    • gronostaj
      gronostaj about 9 years
      First and foremost, updates aren't supposed to break anything and most of the time they don't, except for very rare cases. Even if they do, it's easier to track down problematic update when you're installing one or two before something breaks than when installing entire batch. There's no point to review changes because you want them all, they make stuff better or safer. Please see my comment on @Overmind's answer. Clean install is another issue, when I want to do it quickly I pre-download installers to major updates (Service Packs etc.) and install them manually.
    • I say Reinstate Monica
      I say Reinstate Monica about 9 years
      @someuser You can have the best of both worlds: Configure WU to Download updates but let me choose whether to install them which will scan for required updates in the background but never install them without your approval. They won't auto-install but all applicatble updates will be listed when you do your monthly patching routine.
    • Bigbio2002
      Bigbio2002 about 9 years
      How much RAM do you have? The process is very memory-intensive. I seem to recall a recommended update being released recently which was supposed to improve update check times.
    • fixer1234
      fixer1234 almost 9 years
      The time requirement is a combination of the process and how many updates there are. Updating once/month creates a large backlog of updates. The answers mainly focus on why the process is slow, but your update interval is a major contributing factor.
    • Synetech
      Synetech almost 9 years
      Most files have multiple patches available, but they don’t all come out in a nice, orderly one-at-a-time fashion; they essentially come out randomly. It is difficult enough to apply different patches to a text file (look at the complexity of versioning systems), but with a binary file it is so much worse. If you check a file and it seems to not have patch A1-q44.3pr1S_7 (flat numbers won’t suffice), should you apply it? Does it already have a more recent patch? How does this patch interact/interfere with others? Version patching is mindbogglingly confounding in thought, let alone code.
    • magicandre1981
      magicandre1981 about 8 years
      @CharlesB, no the answer deserves a deletion because it is crap. SUR fixes corrupted files and has nothing to do with slowness.
    • CharlesB
      CharlesB about 8 years
      @magicandre1981 disagree, having installed SUR and KB-3102810, as the answer suggests, it fixed WU slowness.
    • magicandre1981
      magicandre1981 about 8 years
      @CharlesB that update KB3102810 fixes the issue was already posted several times : superuser.com/a/996072/174557, superuser.com/a/997067/174557 so do a search next time. And again, checksur doesn't fix slowness, it repairs corrupted windows files.
    • Simon
      Simon over 7 years
      Can be incredibly slow even with a 500MBps connection on azure on a new VM !
  • gronostaj
    gronostaj about 9 years
    Do not recommend turning off Windows Update. When a zero-day vulnerability is found, Microsoft rolls out a critical update immediately when it's available, out of their normal schedule. Computers with Windows Update disabled won't receive it and will be left vulnerable, while other computers are being patched, so probability of getting attacked spikes upward.
  • Overmind
    Overmind about 9 years
    Statistically, the updates create way too much anomalies to justify a vulnerability prevention in this manner. If a ZDV is found, that specific critical update can be installed without affecting anything else.
  • Michael Hampton
    Michael Hampton about 9 years
    Now that's a thought: that it's intentionally slow. This does make it a real pain to update right after a reinstall, though, which is the situation I'm in now. Some way to speed this up (without setting up a very large WSUS server) would be useful, if possible; waiting a couple of days before being able to use the computer would not be nice...
  • Geruta
    Geruta about 9 years
    What about just leaving the updates on but setting it to (just download. Don't install automatically)? That way, you can pick and choose what's available and it won't install anything unless you approve of it first. That option seems to solve all of your criteria.
  • Michael Hampton
    Michael Hampton about 9 years
    Right, but I still have to wait for it. And wait and wait and wait and wait...
  • Geruta
    Geruta about 9 years
    If you are having it check for updates at 3am and you leave your PC on all the time, it will check and download when you are asleep. Making it fully available and ready for you to play with when you wake up.
  • ssnobody
    ssnobody about 9 years
    There are third party tools to download windows update and a MBSA scan is pretty fast and will give you a list of all missing updates. There was also recently a Windows Update patch (KB3050265) for Windows 7 since Microsoft recognized how agonizing (and non-performant) their implementation was for machines with smaller amounts of RAM.
  • Michael Hampton
    Michael Hampton about 9 years
    And two hours later it finally gave me a list of updates to install. .. Anyway this PC won't remain in Windows all the time as it's dual booted with Linux, and Windows, being the inferior OS, is most definitely secondary. So "leaving it on overnight" isn't very workable. It only gets booted into Windows when there's a specific reason to do so, and there might be several months in between such times.
  • Michael Hampton
    Michael Hampton about 9 years
    This also seems to explain why installing updates is so slow. Is there anything that can be done about it?
  • misha256
    misha256 about 9 years
    @MichaelHampton In my experience, three things can help: 1 Get a PC with excellent single-threaded performance and large CPU cache (e.g. 3.4 GHz i5/i7 Haswell), 2 Get a SSD hard drive, 3 Disable the real-time monitoring component of your AntiVirus software while installing updates.
  • Louis Waweru
    Louis Waweru about 9 years
    @MichaelHampton Decomplicate the update job by letting Windows install them for the simplest case: an update-wise current system (i.e., turn on automatic updates if possible).
  • misha256
    misha256 about 9 years
    @MichaelHampton Some folks have given you mis-information. The MS Update Servers are generally very fast. And scanning your PC/HDD for things to update is also, usually, quite fast. When you next do an update check, open up Resource Monitor first so you can see for yourself what parts of the update take up so much time. You will find that, initially, some time is spent thrashing the hard drive and talking to the internet. After that's done, you will see one CPU core sitting at 100% for an eternity. That's the update engine on your PC figuring out (inefficiently) what to do next.
  • some user
    some user about 9 years
    I have monitored my Windows Update checking for 10 minutes. The CPU and Disk utilization is fairly low. CPU usually 20% or less on idle and occasionally spike to 50%. But memory utilization is high. The PC I used has just 2GB RAM and Windows Update is using 1-1.2GB according to Task Manager.
  • misha256
    misha256 about 9 years
    @someuser Yup, indeed. But you're looking at overall CPU utilization. Look at the CPU utilization of single cores. During Windows Update, you'll see one core maxing out at 100% for eternity. Windows Update engine is clearly CPU-bound to a single thread. Sure RAM usage is high too, but that's not the cause of the slowness. It's the update engine's algorithm that's complex and/or inefficient.
  • some user
    some user about 9 years
    I was looking at per core utilization. And the utilization looks similar for both cores. Neither of them reach 100% for me. YMMV.
  • Michael Hampton
    Michael Hampton almost 9 years
    Checking for updates in Windows 10 preview has been very fast.
  • some user
    some user almost 9 years
    I have a feeling that checking for update is still a CPU and memory intensive operation. But maybe the program is written such that it yields CPU from time to time and therefore not slowing the PC down. I have to wonder if for those who have automatic update turned on, does the computation happens every time the PC is turned on?
  • harrymc
    harrymc almost 9 years
    The answer by @Renju claims the existence of a cache, but in my experience checking for updates is equally slow even if done immediately after a previous check. My own uninformed opinion is that the pruning is done on both the WU servers and the client. I would guess that on the server by hardware and installed Microsoft products/OS; on the client by the updates that are currently already installed on the computer.
  • harrymc
    harrymc almost 9 years
    This guess is motivated by the poster's remark about WU using a lot of RAM but not enormous amount of CPU. This is consistent with a large tree of updates downloaded from Microsoft into local memory, and perhaps a local pruning operation that requires still more info from Microsoft.
  • some user
    some user almost 9 years
    I tried another PC with 12GB RAM. The RAM usage tops off at 3GB and the installer is consuming about 1.2GB RAM. But CPU utilization is higher at 30/70% for 2 cores (avg 50%) and the checking process completed in about 13 mins. During which, there were virtually no activity on network and disk usage.
  • mikus
    mikus almost 9 years
    there is also system restore being created etc, that also takes time (in case of updating already not the check)
  • Sam Watkins
    Sam Watkins over 8 years
    "The algorithm is not guaranteed to succeed, meaning that WU is perfectly capable of destroying the OS or even rendering it unbootable. This is entirely understandable" What a load of nonsense.
  • harrymc
    harrymc over 8 years
    @SamWatkins: Nonsense yourself - this happened to me twice personally, but by all means look at all the other posts of WU woes on this forum.
  • David Tonhofer
    David Tonhofer over 8 years
    "The Windows Update system has to sort through all these combinations to offer the right updates for an individual PC." Yeah, that sounds like a SELECT operation all right. If only there were algorithms to quickly search in large tables, one could call them "indexing". That would help.
  • jpmc26
    jpmc26 over 8 years
    @MichaelHampton But will it be fast in 5 years?
  • Lucero
    Lucero over 8 years
    With Windows 10, MS has added peer-to-peer sharing of updates, which should significantly reduce the stress on WU servers.
  • blackworx
    blackworx over 8 years
    Great info thanks. I'm currently struggling with getting a low-spec laptop up to date from a fresh install of W7, so I'll be giving your process a shot tonight. Have you ever noticed, after installing the SP1 redist, that WU still then wants to download and install all the pre-SP1 updates, as well as SP1 itself? And if so do you have any idea how to avoid it? I've seen this quite frequently of late, and I assume that I've just done something in the wrong order. (I usually go Install W7 > Install chipset/gfx drivers > install SP1 redist > check for updates.)
  • Moab
    Moab over 8 years
    I have seen that behavior, I just let it download and install again, usually when the kb installer runs it sees they are already installed and moves to the next update in the chain, basically it skips those that are already installed. The SUR tool should solve this issue.
  • Moab
    Moab about 8 years
    Seems KB3138612 fixes it on most W7sp1 fresh installs, but I did one yesterday and it still took over an hour to give a list of updates, also I notice on most of my W7 PC's when it starts downloading the updates the screen does not refresh and stays at 0% downloaded until all are downloaded and starts to install them, Windows Update is still broken.
  • AndyC
    AndyC about 8 years
    This worked for me after installing KB-3138612 offline (download it, cut internet connection, install). I then rebooted and MS update was prompting to download packages within a few minutes.
  • LonnieBest
    LonnieBest about 8 years
    The main reason it is slow is because they are indexing your files slow enough so it is not so obvious to resource monitors (which only shows "what they want you to see"), while archiving suspicious files to the NSA. When resource usage is low, and something takes a long time, they're coming to get you! (jokingly)
  • Calmarius
    Calmarius about 8 years
    Why don't MS use an Ubuntu style package management system? It won't slow down over time.
  • harrymc
    harrymc about 8 years
    @Calmarius: Different system architecture.
  • ctrl-alt-delor
    ctrl-alt-delor over 7 years
    How come Debian does all of that, and only takes between a few seconds, and 5 minutes (if it is a very big update). With little CPU usage, it does it quietly in the background, you can shut-down part way through, and you rarely have to reboot.