The IO trashing has likely been present in all versions of freebsd-update. I have a full description and code submitted the improvement against CURRENT here: https://github.com/freebsd/freebsd-src/pull/543 Copy of the description: When there are no updates available there is no need run through the the entirety of fetch_run () This introduces a simple check and its most significant benefit is avoiding the disk intensive phase of "fetch" (i.e. Inspecting system...) as there were no updates anyway. On IO bound hardware, in my case a Raspberry Pi 3, this improvement has reduced runtime duration of freebsd-update fetch from 1m20s down to 1.5s. Even on fast SSD hardware freebsd-update fetch currently takes ~15 seconds, this changes reduces the time to sub second. Again for emphasis: This is for the case when there are no updates. Check early and if the version matches, its done. I trust the github pull request has everything required, if not please let me know.
Forum thread: https://forums.freebsd.org/threads/freebsd-update-fetch-improved-efficiency-please-test-if-youre-interested.82290/
That was supposed to say: "The IO thrashing..."
Jose Luis Duran (jlduran) provided some valuable feedback on my patch on Github regarding style and a good question about the case if there is only a kernel update. I came up with a more robust comparison, simply comparing tags rather than trying to ascertain version information (the more obvious approach in hindsight). https://github.com/freebsd/freebsd-src/pull/543/commits
Thanks for keeping us in the loop. FYI <https://github.com/freebsd/freebsd-src> is a > … (read-only mirror)
Final squashed commit pushed to Github 2 days ago, I'm unsure if the "review" feature of Github is making itself known to Ed Maste. https://github.com/freebsd/freebsd-src/pull/543
https://reviews.freebsd.org/D32570
The github link(s) above are no longer relevant, see Phabricator: https://reviews.freebsd.org/D32570
https://forums.FreeBSD.org/threads/freebsd-update-fetch-improved-efficiency-please-test-if-youre-interested.82290/post-560325 A different approach (workaround) to this problem.
The previous workaround attempt was the right idea but a crude implementation. This is much better: https://github.com/tux2bsd/freebsd-update-probe/blob/main/freebsd-update-probe.sh
root@freebsd-dns:~ # time /root/freebsd-update-probe.sh || freebsd-update fetch install freebsd-update-probe.sh found matching tags, no update needed. 0.067u 0.141s 0:00.60 33.3% 119+187k 0+0io 0pf+0w root@freebsd-dns:~ # time freebsd-update fetch install src component not installed, skipped Looking up update.FreeBSD.org mirrors... 2 mirrors found. Fetching metadata signature for 13.0-RELEASE from update2.freebsd.org... done. Fetching metadata index... done. Inspecting system... done. Preparing to download files... done. No updates needed to update system to 13.0-RELEASE-p10. No updates are available to install. 76.380u 22.593s 1:31.64 107.9% 22+170k 0+0io 0pf+0w On a raspberry pi 3B
With regard to licensing I made it 2 clause BSD as is freebsd-update from Colin P . A few sections of the code are from freebsd-update direct. The intent is this is for the FreeBSD project/community, let me know if anything needs adjusting with regard to this aspect.
My workaround, freebsd-update-probe.sh, provides a definitive measure with regards to room for improvement within freebsd-update. The previous work in https://reviews.freebsd.org/D32570 shows where the fix should be applied but the intertwined nature of freebsd-update does not make this as straight forward as it should be (I bowed out at jail handling, as I do not use them). freebsd-update-probe.sh, satisfies my needs and I have shared it for other people to use if they like.
Until this bug is fixed use this, I've provided this utility: https://github.com/tux2bsd/freebsd-update-probe