I have this older box with spinning hdds and zfs. when doing freebsd-update -r it take hours mostly because installing all the new source files takes forever.
today i had 25k file to install and it took sever hours
looking at the code revealad that every file from INDEX-NEW in /var/db/freebsd-update/files is ungzipped in /var/db/freebsd-update and then installed with
install(1) in its proper location.
on my box this is frigging slow about 2-3 files per second so about 3 hours for 25k files
so i went to hack the script
here i have 3 variants, original, tmpfs add on, newer install(1) version
the zip files contains an INDEX-NEW and ~1000 files from clang source for the install test (they are pulled from a 14.4 box)
for the fi-ni.sh script to work you need install(1) from 14.5 (either test on 14.5 and fix the script to use install instead of /tmp/install or put the 14.5 install in /tmp)
the code in fi-std.sh is mostly pulled directly from /usr/sbin/freebsd-install just the install is done without setting user/group so it work as non root
the files are actually installed under /tmp/FI-script-name so you can delete those after testing
the fi-tmpfs.sh script will try to mount a tmpfs on ftmp but if you run as non root you must mount it before you run the script
here are the results (for 1000 files installed)
zip file containing scripts and 1000 source files
drive.google.com
attached without the gz files, only scripts + structure
today i had 25k file to install and it took sever hours
looking at the code revealad that every file from INDEX-NEW in /var/db/freebsd-update/files is ungzipped in /var/db/freebsd-update and then installed with
install(1) in its proper location.
on my box this is frigging slow about 2-3 files per second so about 3 hours for 25k files
so i went to hack the script
here i have 3 variants, original, tmpfs add on, newer install(1) version
the zip files contains an INDEX-NEW and ~1000 files from clang source for the install test (they are pulled from a 14.4 box)
for the fi-ni.sh script to work you need install(1) from 14.5 (either test on 14.5 and fix the script to use install instead of /tmp/install or put the 14.5 install in /tmp)
the code in fi-std.sh is mostly pulled directly from /usr/sbin/freebsd-install just the install is done without setting user/group so it work as non root
the files are actually installed under /tmp/FI-script-name so you can delete those after testing
the fi-tmpfs.sh script will try to mount a tmpfs on ftmp but if you run as non root you must mount it before you run the script
here are the results (for 1000 files installed)
Code:
[SSDbox> ~/builds/fff]$ time scripts/fi-ni.sh >/dev/null
real 0m1.689s
[SSDbox> ~/builds/fff]$ time scripts/fi-std.sh >/dev/null
real 0m12.079s
[SSDbox> ~/builds/fff]$ time scripts/fi-tmpfs.sh >/dev/null
real 0m3.007s
=======================================================================================
[HDDbox> ~/builds/fff]$time scripts/fi-ni.sh >/dev/null
real 0m1.406s
[HDDbox> ~/builds/fff]$time scripts/fi-std.sh >/dev/null
real 5m17.404s
[HDDbox> ~/builds/fff]$time scripts/fi-tmpfs.sh >/dev/null
real 0m2.767s