How to Reduce startup time

Currently, We want to reduce the startup time ?
With my test, it take about 43 seconds from poweron to ubuntu show desktop.
it take about 16 second on uboot “Retrieving file: /boot/Image”. // it is copying Image to DDR?
We expect that the startup time will been reduce to less than 10 second, is it possible?
Are there any suggestion and document on this issues?
In addation, Are there any avaliable mini rootfs?

One thing I have tried and failed is to set high performance mode as early as possible. I run jetson at max N 100% of the time, so it just seems a waste that it boots in max Q mode and the switches to N. Especially when systemd supports running daemons in parallel, so extra cores and extra clocks would help.

You can time boottime with:

sudo systemd-analyze plot > startup.svg

That will make an SVG showing what runs in parallel on how much time each component takes.

My result: “Startup finished in 5.898s (kernel) + 12.904s (userspace) = 18.803sgraphical.target reached after 10.435s in userspace”. I guess that means to get to desktop in 18.8+10.4s or ~30 seconds. Which is about right.

That’s a rather cool command :) I had to use firefox to open it though since my SVG viewers didn’t like it (the image height is so large that I suspect this is why some viewers failed…SVG is scalable, but I think some applications don’t do that by default and fail by trying to first render it at 100%).

Hello LinuxDev,

My Result:"Startup finished in 7.327s (kernel) + 10.796 s (userspace) = 18.124s.

It seem like it take too long to performance the command sysoot.

Retrieving file: /boot/Image
21864200 bytes read in 17635ms(1.2MiB/s)

Any suggestion to reduce the time on “Retrieving file”?

Thanks

Hi,

The image kernel being used is decompressed, so it is 20-30MB in average. Reducing the time of copying it to the system’s memory usually requires:

  1. To make sure to use eMMC or SD card class 10 media. I assume you are already booting from eMMC.

  2. Reduce the image size by disabling unnecessary drivers and kernel features (anyway this is part of the boot time optimization)

  3. Switch to use zImage to reduce the kernel size.

Besides, zImage is usually faster I am not sure whether it is supported in the current Jetpack version. This post might be useful for you on this topic:

https://devtalk.nvidia.com/default/topic/915758/jetson-tx1/bootz-command-on-tegratx1-not-working/

I do not have a board at hand at this moment to test it, if I had a chance I will take a look at it.

Best Regards,

Hello -

Did you end up trying this/figuring out something that worked? I’m also looking to reduce my boot time and having a difficult time…

Image is actually uncompressed, and zImage is compressed. If Image takes longer than zImage, then it is because of disk read time is the bottleneck compared to decompression time. There is a competition between the time required to decompress and the time to read. However, I don’t think the more recent releases are able to use zImage (I saw zImage go away when we went to 64-bit, which in turn was something the 32-bit U-Boot couldn’t handle…and I think U-Boot is still 32-bit).

The idea is still the same though: Take the existing configuration for the kernel (such as from the running default system’s “/proc/config.gz”), and then trim drivers not needed. For example, if you know for a fact you’ll never need NTFS file system, then remove NTFS through something like “make nconfig”. Test. Then move on to removing the next thing you won’t need. It’s a long process of refinement, but there isn’t much you can do about that (just make sure the original Image is still there, probably for a TX2 modify “/boot/extlinux/extlinux.conf” and add a second entry for a test kernel with an alternate name, and then use serial console to pick that during boot).