Updating Hundreds of FreeBSD Jails at Speed With freebsd-rustdatePermalink

Antranig Vartanian:

Initially, when I heard about freebsd-rustdate I was very skeptical. I have a fear of “Written in <new hip language>”. I thought, however, I’ll wait, and when the time comes, I will try and see how it works.

For the last couple of days I’ve been updating hosts and jails for my customers and my company, and one of the best resources I found was the FreeBSD Update page on FreeBSD’s Wiki, specially the “ freebsd-update Reverse Proxy Cache” section. It has saved me hours when updating the hosts. For some hosts we even did an NFS mount of /var/db/freebsd-update/files directory.

But when it came to upgrading the jails, I realized that this is going to take a very long time. Each host has at least 15 jails, up to 50. There’s a host which has 100+ jails.

I arrived to my parent’s house, installed freebsd-rustdate on a host, and tested it on a single jail. Here is my initial reaction:

holy fuck freebsd-rustdate is fucking fast

freebsd-rustdate by Matthew Fuller is a compatible implementation of the freebsd-update tool used to update the base system of a FreeBSD installation. As the name suggests it’s implemented in Rust, in contrast to freebsd-update, which is implemented in shell script.

The freebsd-rustdate website includes a lot of information about the motivation for the tool, how it achieves its speed, and some differences from freebsd-update. Picking one example from the speed page:

OK, let’s get serious now. Add /usr/src into the mix. Again, going from 13.2-RELEASE to 14.0-RELEASE-p10, but now we have to touch the filesystem a lot more. North of 90k paths.

freebsd-update:

  • -r 14.0-RELEASE upgrade takes a painful 5:51.
  • install is a staggering 24:38.
  • As above, these numbers are for 14.0-RELEASE-p9; it’s close enough.

freebsd-rustdate:

  • upgrade -r 14.0-RELEASE takes 5 seconds.
  • install -a takes 1:41.