Jump to content

Recommended Posts

Posted

Hi.

For my application it would be very advantageous to speed up the boot time of the device as much as possible.

 

The application depends on the network, and unfortunately it seems it takes a while for the interface to establish a connection.

After plugging in the device, I count that it takes about 25-30 seconds until my application starts (which is set to start on reboot by cron).

However, at that time, the network is still not up, so it matters little that the application has started. It takes another 20 seconds or so until the device is reachable by the network. So total 45-50 seconds from boot.

Why is this?
I see in systemd-analyze that NetworkManager.service starts at around 30 seconds, same as cron. So what is the holdup? The IP is static and it is plugged in with Ethernet, so I don't understand what takes time when it comes to connecting to the network, after the network manager has started. How can I troubleshoot this or make it connect faster?

 

Bonus question. Another thing that takes a lot of time in the boot is armbian-ramlog.service, at nearly 8 seconds long. See attachment for full boot chart. Is there a way to shorten this too, without disabling ram logging entirely?

 

bootanalyze.svg

<
Posted

I have a similar issue, with NetworkManager.service taking over 30 seconds to start, but it doesn't happen every time.  Half of the time, NetworkManager.service only takes a few seconds to start.

 

I found this thread which most closely matches the behavior I'm seeing: https://forums.linuxmint.com/viewtopic.php?t=426864

 

However, I can't reproduce it every time, and I tried removing /usr/lib/systemd/system-generators/netplan but that had no impact on the issue (and "netplan generate" doesn't take more than a second to run).  So I'm kind of at a loss.....

Posted (edited)

@grixm I know the issue you describe from the past 5-10 years (various distros) and made several workarounds depending on distro and release. cron is not default anymore in some other .rpm distro, so I would suggest you debug further and look into dependencies in systemd services and write an own systemd service file with proper dependencies.

A problem might be that NetworkManager-wait-online.service gets already passed when still no valid IP+DNS. I don't know the latest status. I see it is disabled on my NanoPi-R6C Armbian Bookworm, but I might have done that myself as I primarily need a bridge there and MAC addresses vary so I set a cloned mac address (on the bridge device) so that DHCP can still work. But a bridge setup can take time (see STP etc), depends on what you do.

If no bridges, remember it is not only your SBC but an unknown homelan/router (for us , other forum members) as well, so you better make sure you figure out every trace of NM and networking yourself. I still have a sort of ping-alive-check for 1 SBC to see it it can reach my NAS. That was the only thing I could think of to make it reliable. There is also a method in NM somewhere that you can use to show 'internet works', similar to what Android uses. It is used in openSUSE as extra non-default setting in some .conf file I remember, Armbian I don't know.

Ramlog does an rsync, I usually disable or remove it for several reasons.

 

@dnwhoop02 I haven't really looked at that linuxmint forum, it is not Armbian Ubuntu(/Noble?) so better look in more detail at your own system. I recently discovered that netplan generator, it did cost me a lot of time, luckily I use the same .nmconnection files on Armbian Bookworm (VLANs etc), so I got my stuff back, but I did not manage to remove netplan.io. It seems Canonical made a hard dependency between netplan and NM. I might go back to Bookworm (from Noble) or switch to preTrixie/Testing due to that. I know netplan is good for Canonical, but not for me, feels like the new snapd.

But in short, I have seen the .yaml files being generated, but that was only once when netplan.io got package update or so. It should not delay network-setup-time, but you need to check in more detail what the relation between netplan and/or netplan.io is I think. The other option, systemd-networkd, does not work out-of-the-box in my LAN (in the minimal images), but maybe it does work for you.

Edited by eselarm
Posted
4 hours ago, eselarm said:

systemd-networkd, does not work out-of-the-box in my LAN

 

Interesting, do you have explanation?

Posted
19 minutes ago, Igor said:
4 hours ago, eselarm said:

systemd-networkd, does not work out-of-the-box in my LAN

 

Interesting, do you have explanation?

I have not looked into various systemd-networkd files, but I think it might have to do with the fact that my DNS and router are different; It should not be a problem, but that is what I think. I am not sure anymore what I did, but I got NM installed and a set of .nmconnection files copied from NAS, then got NM running (done via serial console) and did not look back.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines