I have a koisk / HMI type scenario where I need to boot quickly into the chromium browser.
I asked the AI what I can do to speed up boot times, but all it said was disable bluetooth and uart. with:
sudo systemctl disable hciuart.service
sudo systemctl disable bluetooth.service
surely there are other things which can be done.
I am using the bookworm version of PiOS with a raspberry pi4b 4GB ram.
My target boot time is 25 seconds from cold start to page load.
yes, I am booting from a micro sd card. Perhaps this picture will be helpful:
from $systemd-analyze plot > boot.svg
eh, I guess its pastebin for this svg image, https://pastebin.com/0fxHJuNr
its kinda huge and hard to read if converted to an accepted image format.
Using a pi5 is not an option, this is for a product I'm designing, to which the bill of materials have already been submitted, the changing of which is impractical at the very least.
From cold boot to graphical user space, it is approximately 19 seconds. Still I would like to make it as fast as possible.
There is a touch screen using the gpio, and display port, this is the primary interface. While I do not think I need wifi / bluetooth, when I tried disabling wifi previously, the wired networking failed. I don't think I need audio, or USB though I only really care if limiting them gets me into the browser faster.
1 Answer 1
I installed Arch Linux ARM on my Pi as it is a much more minimal distribution. After install (and cleaning the pacman cache) it is 3GB, most of which is X11 and Chromium. From applying PoE power to X11 takes just over 20 seconds, and Chromium running in kiosk mode renders the web page at the 29.5 second mark (that's counting from first applying power). There is no WiFi or Bluetooth configured.
I don't think you are going to be able to get it much faster than that, unless you upgrade to a faster Pi and use an SSD. Even then most of the time is spent initialising hardware, so you wouldn't see that much of a difference. I think you'd have to custom compile your kernel and disable every little thing you aren't using to see any meaningful speed increases, such as disabling USB support to avoid spending time checking for the presence of USB devices.
The problem is that running a web browser requires a lot of operating system support, so short boot times and displaying web pages are somewhat mutually exclusive.
Having said that, your SVG diagram shows you're spending quite a few seconds in things like retrieving the current time, checking the Pi EEPROM for an update, etc. You're also loading a lot of services I don't have, like Avahi and Plymouth. Likely you could disable a bunch of these which may give you some improvement.
-
1Im down to a 15 second boot time to page load, from off to system load. Good tips. Its hard to tell which programs depend on which services, but thats probably a separate question.Bangor Makerspace– Bangor Makerspace2025年01月22日 13:27:34 +00:00Commented Jan 22 at 13:27
My target boot time is 25 seconds
what time have you achieved?sudo systemctl disable NetworkManager-wait-online.service