Boot Performance

ColinPercival is coordinating an effort to speed up the FreeBSD boot process and would like to see FreeBSD become far more competitive in 14.0 and beyond. Some improvements have already been made since 13.0.

An Amazon EC2 c5.xlarge instance is being used as a reference platform and measuring the time between the instance entering "running" state and when it is possible to SSH into the instance.

For the most recent work, see also SummerOfCode2024Projects/SpeedingUpTheFreeBSDBootProcess

Boot Components

Boot time consists of four consecutive stages:

  1. System: BIOS/UEFI, before running any FreeBSD code – we can't do anything about this.
  2. FreeBSD: boot loader.
  3. FreeBSD: kernel, before init starts running.
  4. FreeBSD: userland boot process.

Boot Profiling

For visual analysis of the four stages: use tslog(4) buffer dumps to generate flame graphs.

For example, run the following command to extend the GENERIC kernel configuration file for FreeBSD/amd64:

printf '%s\n' '' 'options         TSLOG                   # <https://wiki.freebsd.org/BootTime#tslog>' >> /usr/src/sys/amd64/conf/GENERIC

– then build, install and use the GENERIC kernel.

Checkout the freebsd-boot-profiling repository, cd to the checkout, then run:

sh mkflame.sh > tslog.svg

Current Performance

Some statistics collected in August 20211:

Performance is measured using the ec2-boot-bench utility.

How it started

How it's going

(As of late March 2022.)

Known Performance Issues

Loader (~260 ms, more on first boot):

Kernel (~ 400 ms):

Userland (~ 3500 ms, more on first boot):

Performance Issues not affecting EC2

In addition to the above, there are some performance issues which don't affect the benchmark system but should be addressed to help other platforms.

On Colin's 13.0-RELEASE laptop:

Past Performance Improvements

Boot performance improvements which have been prompted by this effort:


CategoryProject CategoryPerformance

BootTime (last edited 2024-08-28T12:09:48+0000 by MarkLinimon)