Optimize boot time

i want optimize boot time in openwrt build
how i can optimize boot time in the openwrt source ? i should active any package in menuconfig ?

In general, what should I improve boot speed?

1 Like

Define preinitialisation features you'd like to remove. IMHO not wise.

Failsafe wait seconds or preinit>net would be the only viable areas to consider in which case runtime hooks are available.

1 Like

I did not understand clearly
Is it possible to explain more fully?

1 Like

There isn't any "optimize boot time" button, if that is what you are looking for. Current boot time is as good as it can be, unless you are willing to lose some functionality, or are willing to spend a lot of time tuning everything for your hardware and needs.

2 Likes

Yes, I know there's nothing ready for optimization
I want to know exactly which section of the settings I need to do this optimization

1 Like

Connect a USB to UART cable and observe the logs as it boots.
Find something that is taking excessively long time to complete and investigate ways to improve or eliminate it.

It really is trial and error and checking the logs or adding more logs for more detailed information.

You could also check dmesg/kernel logs for most of the logs

4 Likes

Thank you so much for guidance
Of course, I have an internal USB modem connection for the 4glte, and it seems to me that it's time consuming
Do you have any comments on how to speed up this section?
Of course, the connection happens after the full boot

1 Like

The same advice.
You need to read the logs and become familiar with your hardware.
You need to judge if the time taken is normal or excessive. Then investigate if it is excessive.

If It could be easy enough to be explained in a forum post, it would have been done before. I think you are looking for an easy solution to a complex problem.

5 Likes

Not my friend I'm not looking for a comfortable way
But I'm looking for tips to improve the speed. If you know a tutorial or anything that helps me know. I want to read anything to do this
If there's any general guidance, I'd be happy to know. My intention is to speed up the implementation of the webserver and identify faster the usb 4glte modem

1 Like

What is your current boot time and what are you striving for (both, times for webserver and LTE modem)? What is the maximum boot time you are willing to accept?

1 Like

read logs to see what is taking so much time.
Most OpenWrt devices boot in 10 seconds or less, when they take more time it's either because there is a bug somewhere or because of things out of their control (i.e. bootloader wastes time before booting OpenWrt, modems take a lot of time to start up on their own).

Might be worth it to automate tasks instead, so that it still takes time but it does not require you to interact with it.

1 Like

Full Internet access time is 2 minutes and 30 seconds
And boot time until access to the web server is 1 minute and 10 seconds
I want to reduce that time as much as possible

1 Like

To read the log, as well as to evaluate and prioritize the sections, there is a guide or training that I can study?
I checked the files and hit the files like this in the boot section S00boot and ...
Should these files be edited for boot priority?

1 Like

I suspect most of that would be the LTE modem.
In my case LAN and WLAN are ready after 50 seconds. But xDSL modem and PPPoE take another 60 seconds for a total 110 seconds from when OpenWrt starts.

1 Like

from commandline write
logread
to see system log, and
dmesg
to see kernel log.
The same is also available in Status -> System Log or Status -> Kernel Log
in the web interface.

in the dmesg/Kernel Log you see a number in brackets, like [ 21.700198]
That's [ seconds.milliseconds ] from boot, so in the example that would be 21 seconds from boot.

All services are started by init scripts. To see what each init script is doing, for legacy init scripts https://openwrt.org/docs/techref/initscripts
and this for the more modern ones https://openwrt.org/docs/guide-developer/procd-init-script-example

For the output in the logs that shows what is the modem doing, check this documentation https://openwrt.org/docs/guide-user/network/wan/wwan/start

Openwrt will usually blink a led on the device while it is booting, and will stop blinking it when it has finished booting.

If it is like I'm suspecting, the issue here is that the LTE modem takes a long time to start up. They always take a long time to start up and connect to the network. Check if it does the same if connected to a PC or other device.

2 Likes

If you have 5 GHz wireless, a full minute of those 2,5 minutes are spent listening for radar interference on DFS channels. No way around that.

1 Like

What about non-DFS channels (in areas where they exists)?

1 Like

I saw a modem of greenpacket that worked with openwrt and had a good time. A modem lte
I like to have a very high speed boot

1 Like

Thank you very much for your very good guidance
I'm sure to start checking out
Yes, lte modems usually have a lot of time to identify, but there are modems (not with openwrt, though) that boot very fast, such as Huawei's I60 Modem

1 Like