CFanのBlog

A good day for snow-viewing

ChatGPT for Windows update stuck on ‘installing update’: Delivery Optimization throttles user-initiated downloads to 1 Mbps

No comments on ChatGPT for Windows update stuck on ‘installing update’: Delivery Optimization throttles user-initiated downloads to 1 Mbps
364 views

Translated from the Chinese original by Claude.

For the past couple of days the ChatGPT desktop app (the Microsoft Store version) has been showing ‘正在安装更新’ (‘Installing update’), saying it will restart by itself once that’s done, yet the progress bar only crept forward a little every few hours. The previous day’s version was even more absurd: it took eleven and a half hours to download, then, an hour or so after finishing and before it had been installed, the system threw it away, and the new version started downloading again from zero.

After an evening of fiddling and several detours, I finally found the cause in Delivery Optimization’s own log: it throttles ‘user-initiated’ downloads automatically. Full speed for a few seconds, then it switches to ‘Limited’ and waits 2–4 minutes, then full speed for a few seconds again, round and round. The Activity monitor in Settings shows it too: this month, user-initiated downloads averaged just 1.1 Mbps, while background downloads managed 271 Mbps.

The fix is simple: in Delivery Optimization’s advanced options, set an ‘Absolute bandwidth’ limit for foreground downloads, with a value higher than your actual connection speed. After the change, an update that had been stuck at 45% for twenty minutes downloaded and installed in seconds. Changing DNS, editing hosts and blocking the ‘slow’ IPs all made no difference. Below is a record of the troubleshooting.

Symptoms

 

  • ChatGPT shows a pop-up, ‘正在安装更新 / 安装完成后,ChatGPT 将重新启动。’ (‘Installing update / ChatGPT will restart once installation is complete.’), and the progress bar barely moves.
  • There’s no installer to be found in Task Manager, and the disk and CPU are both idle.
  • The previous day’s 26.1016.8120 took 11.6 hours to download, and about an hour after it finished the system deleted it without installing it; the newly released 26.1016.8622 then started downloading from scratch.

Who’s doing the downloading?

The Store version of ChatGPT is actually packaged as OpenAI.Codex. Its updates aren’t downloaded by ChatGPT itself: the Store’s install service hands the download over to the Delivery Optimization service (DoSvc), and the AppX Deployment Service (AppXSvc) unpacks the data into C:\Program Files\WindowsApps as it arrives, which is why there’s no installer in Task Manager.

In the AppX deployment log, Microsoft-Windows-AppXDeploymentServer/Operational, every deployment ends with a performance summary (event 613):

The download progress can be seen with Get-DeliveryOptimizationStatus (signatures removed from the URL):

A 924 MB package, of which 425 MB had arrived in 2 hours 18 minutes. CacheHost is a Microsoft cache server assigned by DO, and every byte came from it. Note the Priority: Foreground: it matters later.

Detour 1: the network, DNS, blocking IPs

My first thought was that the cache server or CDN node was too slow, so I was going to change DNS, edit hosts, or block this cache server. Before doing anything I measured it: taking the URL from SourceURL, I downloaded the first 20 MB of the same file from each of the nodes that different DNS servers resolve it to:

NodeWhere it came fromTime for 20 MBSpeed
74.177.135.22Cache server assigned by DO0.36 s56 MB/s
2.18.27.142 / .178Local DNS (Akamai)0.33–0.36 s56–61 MB/s
2.16.168.47 / 2.20.245.169DNSPod (Akamai)0.44–0.47 s42–46 MB/s
146.75.30.172AliDNS (Fastly)1.27 s16 MB/s
199.232.210.172 / .214.172Google and Cloudflare DNS (Fastly)0.29 s70 MB/s

The end of the file, which nobody had requested yet, was just as fast. Downloading the whole package again with BITS (also a system service) took 12 seconds for the 924 MB.

Later I also noticed that every time it raced to about 400 MB and then got stuck, and wondered whether it was being throttled after 400 MB. So I downloaded the whole file from the cache server over a single connection: 9 seconds, around 100 MB/s all the way, with no slowdown past 400 MB.

The network, the CDN and the cache server were all fine; changing DNS or hosts, or blocking IPs, wasn’t going to help.

Detour 2: locked files, IDM

Logging how much DO had downloaded every second showed the figure jumping only once every two or three minutes, by 1–4 MB each time, with zeros in between. An ordinary user can list the new version’s folder under WindowsApps, and the write times of the unpacked files also came in batches about 145 seconds apart. The disk was 97% idle and AppXSvc used next to no CPU; it looked as if it was waiting for something.

First I suspected a locked file. Every 6 minutes the AppX deployment log had a batch of ‘错误 0x12C: 删除文件 …\WindowsApps\Deleted\OpenAI.Codex_26.1016.8120.0…\app\icudtl.dat 失败’ (‘error 0x12C: deleting file … failed’). A look with fsutil hardlink list showed that AppX hard-links the files that are identical in the old and new versions, so the icudtl.dat in the discarded version was the very same file as in the running version, and it couldn’t be deleted while ChatGPT was open:

This is harmless and was cleaned up once ChatGPT was closed, but it had nothing to do with the slowness: with ChatGPT fully quit, the download still only jumped once every few minutes.

Next I suspected IDM, which installs a WFP driver, IDMWFP, to monitor downloads across the whole system. Quitting IDM changed nothing.

The cause: Delivery Optimization throttling itself

In the end I went to DO’s own log. It needs administrator rights, and the times in it are UTC:

These are the entries after the new version, 26.1021.2667, started downloading (only the relevant lines kept):

That made everything clear at once:

  • DO only downloads at full speed in the ‘Unlimited’ phases, which last just 6–8 seconds each; then it switches to ‘Limited’ and waits 100–245 seconds, reporting ‘No progress’ the whole time. The downloaded total jumping every few minutes matches those few seconds of each Unlimited phase exactly.
  • ‘Races to 400 MB, then gets stuck’ wasn’t some 400 MB limit either: the very first Unlimited phase lasts 6 seconds, and at 70 MB/s that comes to about 400 MB.
  • The earliest entry in the log is from 18 October, and it’s been like this ever since: ‘Unlimited to Limited’ appears 154 times in all.

Why is the Limited phase almost zero? There’s just one line in the log where DO records its ‘maximum measured speed’:

The log doesn’t give the unit; if it’s B/s, that’s a mere 9.5 KB/s. By default foreground downloads are limited to ‘90% of the measured bandwidth’, and if DO keeps throttling to this ridiculous estimate, then while it’s throttling itself the speed it measures can’t get any higher either, and so it stays stuck. This part is my guess, but it fits the results below.

Also, the configuration DO fetches from Microsoft’s servers contains these two entries, so automatic throttling looks like a switch flipped from the cloud (perhaps only recently turned on for some machines, which would explain why I’d never run into it before):

In fact you can see it right there in Settings: Settings → Windows Update → Advanced options → Delivery Optimization → Activity monitor shows this month’s ‘平均下载速度(用户启动)’ (‘average download speed (user-initiated)’) at only 1.1 Mbps, while ‘平均下载速度(后台)’ (‘average download speed (background)’) is 271.0 Mbps. Clicking Update in the Store and updates that apps trigger themselves both count as ‘user-initiated’ (foreground) downloads.

The fix: an absolute bandwidth limit for foreground downloads

  1. Open Settings → Windows Update → Advanced options → Delivery Optimization → Advanced options.
  2. Under ‘Download settings’, choose ‘Absolute bandwidth’.
  3. Tick ‘Limit how much bandwidth is used for downloading updates in the foreground’ and enter a value higher than your actual connection speed, say 999 Mbps. You can set the background one at the same time.

Once it’s set, you can confirm with Get-DOConfig that DownloadForegroundLimitBps now comes from SettingsProvider:

DO then throttles to this fixed value rather than to the speed it measured. The effect was immediate: the update that had been stuck at around 45% for twenty minutes finished downloading within seconds of the change (811 MB → done), AppX completed the deployment straight away, and ChatGPT was updated to 26.1021.2667. Keep this setting for good: switch back to ‘Percentage of measured bandwidth’ and it will very probably slow down again.

Plan B: download the MSIX by hand and install it

Before I found the cause, I used this method to get one version installed. It doesn’t need administrator rights, but the Store update must still be downloading (so that DO shows the URL):

Then quit ChatGPT completely (right-click the tray icon and quit), and in Windows PowerShell (powershell.exe; PowerShell 7 can’t load this WinRT type) cancel the stuck update in the Store, then install:

The whole installation took 25 seconds. Mind you, only use the download URL the system itself gives you: it carries a signature and an expiry time, so it stops working after a while. Don’t download the MSIX from third-party sites.

If it happens to you

  1. First look at Settings → Windows Update → Advanced options → Delivery Optimization → Activity monitor: if the average download speed for ‘user-initiated’ is far lower than for ‘background’, this is very probably your problem.
  2. To confirm it, run Get-DeliveryOptimizationLog as administrator and look for DownloadRateStrategy: Unlimited to Limited.
  3. In Delivery Optimization’s advanced options, set an absolute bandwidth for foreground downloads, with a value higher than your connection speed.
  4. Changing DNS or hosts, or blocking IPs, won’t help: there’s nothing wrong with the network itself.

Leave a comment

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.