Speed up the installation of base-os
Install and update seems to take a long time, especially now with the new WebUI where it has a lot of small files.
The python process seems to be CPU bound, its at 100% CPU usage. We need to improve that one way or another.
Using multiprocessing module might be the way to go.
#2 Updated by Sean Fagan about 4 years ago
- Status changed from Unscreened to Screened
- Priority changed from Blocks Until Resolved to Important
It is dependent on processor speed, installation source, and installation target.
This is not blocking until resolved, since it's been shipping this way for over two years.
#3 Updated by Sean Fagan about 4 years ago
There are two relatively easy things to check.
- Make sure the version of freenas-pkgtools is up to date, since one of the things it does is put the target BE into async mode while doing the update/install.
- If that's not enough of an improvement, perhaps use pigz -- it made a significant difference in the package creation process. But then again, the build servers have lots of CPU cores.
#4 Updated by William Grzybowski about 4 years ago
We have been shipping for two years but the size of the image and the number of files has increased in 9.10.3. Thus we are noticing a bigger difference now.
1. We are using the latest of freenas-pkgtools in master builds.
2. Adding pigz might be something but it could prove to be harder to use given how the tar file is read in files extract.
I mentioned multiprocessing because we could extract multiple files at once (within same dir) since most of the overhead seems to be from python objects as well calculating sha256 and reading the file (compressed).
There are downsides as well but well, just wanted to give some idea. We have quite a few people complaining how long it takes to install/upgrade.
#12 Updated by Sean Fagan about 4 years ago
So, without any changes (other than to keep track of time), the install on a VM on my Mac takes 233 seconds. That's not particularly slow -- as I would generally expect, it's faster than Corral is.
Now, of course, that's on a VM with a super-fast SSD, so installing to an actual thumb drive is going to be considerably slower.
Will time an update next.
#17 Updated by Sean Fagan almost 4 years ago
- Status changed from Screened to 19
commit:acdd7f88492938a2ae888305d4d434a742d9c648 improves installation speed of base-os significantly (well, the post-installation gap is significantly smaller now). There's not a lot to be done about the fact that there are almost 80,000 filesystem objects in base-os right now, most of which are significantly smaller than the blocksize used by both the filesystem and usb devices. Doing a checksum of the files right after being written does not appear to be a limiting factor, since from running iostat it's clear that I/O is simply not being done for large periods -- that's what caching and asynchronous writes get you.
(Now, switching to something other than gzip may help, but has compatibility issues; another possibility is to decompress the package file after verification but before extraction. I've not benchmarked either of those, as getting rid of the very significant delay between the package being installed and it going onto the next package seemed like a good start.)
#25 Updated by Rishabh Chauhan over 3 years ago
I just upgraded the VM from FreeNas 11 u4 to FreeNas PreRelease(Beta1)...
System specs: 4096MB RAM, Hard-disks: 20GB, 40GB, 40GB
Update and reboot time: 11min 51sec
After talking to Sean, I found that previously it was taking +30min for the same process.., Hence Test Passed