Upgrading HDD to SSD but boot is still slower than expected

Questions about Grub, UEFI,the liveCD and the installer
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Nesbit

Upgrading HDD to SSD but boot is still slower than expected

Post by Nesbit »

Hello everybody,

I have recently replaced the hard drive of my Dell Precision M4800 with a Samsung EVO 850 SSD (250GB), and would expect a boot time of less than 10s, but in the current state it takes ~27s:
Startup finished in 3.734s (firmware) + 3.345s (loader) + 6.530s (kernel) + 12.877s (userspace) = 26.487s
I attach here the outputs of dmesg and systemd-analyze plot commands:
https://drive.google.com/open?id=0B4yzp ... zlyMlpBSTA
https://drive.google.com/open?id=0B4yzp ... lVBNmJFV3M

From the output, a big bottleneck in the userspace stage lies at NetworkManager-wait-online.service (11.433s). A solution I found via Google is to disable this service:

Code: Select all

systemctl disable NetworkManager-wait-online.service
but I'm not sure if it's safe to do so. Any comments on this will be appreciated.

Apart from userspace, I find that the other stages (firmware + loader + kernel) also took a long time. Could you please suggest some improvements?

Thank you very much in advance for your help!
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
zaqcroyd

Re: Upgrading HDD to SSD but boot is still slower than expected

Post by zaqcroyd »

After seeing a suggestion to make that change here on the forums viewtopic.php?f=60&t=252387, I chopped 8 seconds out of my boot time (which was over a third of the total). I believe the discussion in that topic implied that it was a safe thing to do if you used a wired ethernet connection, but that there might be complications if you were using WiFi and that took a little bit of time to handshake and get the connection up. Anyway, take a look at the topic as it has other ideas.
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Upgrading HDD to SSD but boot is still slower than expected

Post by catweazel »

Nesbit wrote:From the output, a big bottleneck in the userspace stage lies at NetworkManager-wait-online.service (11.433s). A solution I found via Google is to disable this service:

Code: Select all

systemctl disable NetworkManager-wait-online.service
but I'm not sure if it's safe to do so. Any comments on this will be appreciated.
It's ok to issue that command if you use wired ethernet. I'm not so sure of the effects on wifi.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
Nesbit

Re: Upgrading HDD to SSD but boot is still slower than expected

Post by Nesbit »

zaqcroyd wrote:After seeing a suggestion to make that change here on the forums viewtopic.php?f=60&t=252387, I chopped 8 seconds out of my boot time (which was over a third of the total). I believe the discussion in that topic implied that it was a safe thing to do if you used a wired ethernet connection, but that there might be complications if you were using WiFi and that took a little bit of time to handshake and get the connection up. Anyway, take a look at the topic as it has other ideas.
catweazel wrote:
Nesbit wrote:From the output, a big bottleneck in the userspace stage lies at NetworkManager-wait-online.service (11.433s). A solution I found via Google is to disable this service:

Code: Select all

systemctl disable NetworkManager-wait-online.service
but I'm not sure if it's safe to do so. Any comments on this will be appreciated.
It's ok to issue that command if you use wired ethernet. I'm not so sure of the effects on wifi.
Thanks. Unfortunately this is my laptop and it's connected to wifi almost all the time :(
mr_raider
Level 7
Level 7
Posts: 1897
Joined: Sun Jun 20, 2010 9:50 am
Location: Montreal, QC

Re: Upgrading HDD to SSD but boot is still slower than expected

Post by mr_raider »

I use it on wifi systems too. Not sure if there is an issue, but i disabled the service and it seems fine.
Image
User avatar
Mick-Cork
Level 4
Level 4
Posts: 493
Joined: Sun Mar 23, 2014 10:10 pm
Location: West Cork & London

Re: Upgrading HDD to SSD but boot is still slower than expected

Post by Mick-Cork »

I recently made two changes that shaved roughly 10 - 11 secs off boot up, and 4 seconds off shutdown. I only use WIFI to connect. Cinnamon 18.2.

1. Changed from MDM to LightDM login. (approx 4 - 5 secs off boot / 4 off shutdown).

2. Changed the ExecStart line in lib/systemd/system/NetworkManager-wait-online.service as follows, ie: reduced timeout to '2' (approx 6 - 7 secs off boot up) :

Code: Select all

[Unit]
Description=Network Manager Wait Online
Documentation=man:nm-online(1)
Requisite=NetworkManager.service
After=NetworkManager.service
Before=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/bin/nm-online -s -q --timeout=2
RemainAfterExit=yes

[Install]
WantedBy=network-online.target
LightDM is the default if you do a fresh install of 18.2. MDM remains the default if you've updated from an earlier 18 release. I use auto-login so that req'd a couple of extra LightDM config tweaks - info available on the blog and forum if needed.

System: Dell E5450 i5, 8Gb Ram, SSD.
Nesbit

Re: Upgrading HDD to SSD but boot is still slower than expected

Post by Nesbit »

mr_raider wrote:I use it on wifi systems too. Not sure if there is an issue, but i disabled the service and it seems fine.
Interesting. Have you just disabled it after seeing my post or did you do that before? If it's been some time you have done that and you haven't observed any problem then it's worth to try.
Mick-Cork wrote:I recently made two changes that shaved roughly 10 - 11 secs off boot up, and 4 seconds off shutdown. I only use WIFI to connect. Cinnamon 18.2.

1. Changed from MDM to LightDM login. (approx 4 - 5 secs off boot / 4 off shutdown).

2. Changed the ExecStart line in lib/systemd/system/NetworkManager-wait-online.service as follows, ie: reduced timeout to '2' (approx 6 - 7 secs off boot up) :

Code: Select all

[Unit]
Description=Network Manager Wait Online
Documentation=man:nm-online(1)
Requisite=NetworkManager.service
After=NetworkManager.service
Before=network-online.target

[Service]
Type=oneshot
ExecStart=/usr/bin/nm-online -s -q --timeout=2
RemainAfterExit=yes

[Install]
WantedBy=network-online.target
LightDM is the default if you do a fresh install of 18.2. MDM remains the default if you've updated from an earlier 18 release. I use auto-login so that req'd a couple of extra LightDM config tweaks - info available on the blog and forum if needed.

System: Dell E5450 i5, 8Gb Ram, SSD.
Thanks. My LM is a fresh installation so I'm already using LightDM. I'll try your second suggestion and get back :)
Nesbit

Re: Upgrading HDD to SSD but boot is still slower than expected

Post by Nesbit »

Before:
3.734s (firmware) + 3.345s (loader) + 6.530s (kernel) + 12.877s (userspace) = 26.487s

After enabling Fast Boot in BIOS:
2.887s (firmware) + 3.347s (loader) + 6.496s (kernel) + 8.450s (userspace) = 21.181s

After setting NetworkManager-wait-online.service timeout to 2s (as suggested by Mick-Cork):
2.819s (firmware) + 3.365s (loader) + 6.501s (kernel) + 4.036s (userspace) = 16.723s

After disabling NetworkManager-wait-online.service:
2.821s (firmware) + 3.357s (loader) + 6.499s (kernel) + 1.178s (userspace) = 13.857s

This is not bad. However, the kernel boot time is still high. It doesn't seem to have many references on how to reducing kernel boot time.

Following this post, I changed MODULES=most to MODULES=dep in /etc/initramfs-tools/initramfs.conf but surprisingly this increased slightly the boot time:

2.817s (firmware) + 3.320s (loader) + 6.388s (kernel) + 1.886s (userspace) = 14.412s
Kernel time was actually reduced but more time was added later in userspace. I don't know what happened. Here's the output of dmesg.
It should be noted that when running "sudo update-initramfs -u" I got a warning:
update-initramfs: Generating /boot/initrd.img-4.8.0-53-generic
W: Possible missing firmware /lib/firmware/i915/kbl_dmc_ver1_01.bin for module i915
Warning: No support for locale: en_US.utf8
Suggestions on how to optimize loader + kernel boot time are very appreciated. Thank you!
User avatar
catweazel
Level 19
Level 19
Posts: 9763
Joined: Fri Oct 12, 2012 9:44 pm
Location: Australian Antarctic Territory

Re: Upgrading HDD to SSD but boot is still slower than expected

Post by catweazel »

Nesbit wrote:Suggestions on how to optimize loader + kernel boot time are very appreciated. Thank you!
I don't see how you can get much better without building and optimising your own kernel.

I have a Ryzen 1800X and run Mint off a 32Gb/s NVMe and get a 13s startup. I think you're chasing a dream, to be honest.
"There is, ultimately, only one truth -- cogito, ergo sum -- everything else is an assumption." - Me, my swansong.
User avatar
Mick-Cork
Level 4
Level 4
Posts: 493
Joined: Sun Mar 23, 2014 10:10 pm
Location: West Cork & London

Re: Upgrading HDD to SSD but boot is still slower than expected

Post by Mick-Cork »

Good going though, shaving 50% off boot up time :)

Nesbit, I take it from your tests that disabling NetworkManager-wait-online.service hasn't caused any probs? I'm pondering on doint the same here now.

If you do manage to make any further improvements be great if you could keep this thread updated - handy reference.
mr_raider
Level 7
Level 7
Posts: 1897
Joined: Sun Jun 20, 2010 9:50 am
Location: Montreal, QC

Re: Upgrading HDD to SSD but boot is still slower than expected

Post by mr_raider »

Nesbit wrote:
mr_raider wrote:I use it on wifi systems too. Not sure if there is an issue, but i disabled the service and it seems fine.
Interesting. Have you just disabled it after seeing my post or did you do that before? If it's been some time you have done that and you haven't observed any problem then it's worth to try.
A month ago.
Image
Nesbit

Re: Upgrading HDD to SSD but boot is still slower than expected

Post by Nesbit »

catweazel wrote:
Nesbit wrote:Suggestions on how to optimize loader + kernel boot time are very appreciated. Thank you!
I don't see how you can get much better without building and optimising your own kernel.

I have a Ryzen 1800X and run Mint off a 32Gb/s NVMe and get a 13s startup. I think you're chasing a dream, to be honest.
Well I guess one can always disable 'unnecessary' services to get further speed up, as done in this post (not up-to-date). I'm quite happy with the 13s for now though.
Mick-Cork wrote:Good going though, shaving 50% off boot up time :)

Nesbit, I take it from your tests that disabling NetworkManager-wait-online.service hasn't caused any probs? I'm pondering on doint the same here now.

If you do manage to make any further improvements be great if you could keep this thread updated - handy reference.
Still no problem so far :mrgreen:
mr_raider wrote: A month ago.
Thanks. I did the same thing :D
ColdBootII

Re: Upgrading HDD to SSD but boot is still slower than expected

Post by ColdBootII »

I don't wish to necro-bump the thread, just wanted to say, this service started eating boot time since the last update to network manager gnome package in May. As it seems to affect many Mint machines perhaps it should be bug reported.
jglen490

Re: Upgrading HDD to SSD but boot is still slower than expected

Post by jglen490 »

It's good that you are on your way to shaving 17 or so seconds off an already decent boot time. I'm not sure how often you actually boot your machine, but eventually that time will add up to something. Is this being offset by anything else, such as starting your wireless connection after boot?
Nesbit

Re: Upgrading HDD to SSD but boot is still slower than expected

Post by Nesbit »

ColdBootII wrote:I don't wish to necro-bump the thread, just wanted to say, this service started eating boot time since the last update to network manager gnome package in May. As it seems to affect many Mint machines perhaps it should be bug reported.
As suggested I have reported it as a bug ;)
jglen490 wrote:It's good that you are on your way to shaving 17 or so seconds off an already decent boot time. I'm not sure how often you actually boot your machine, but eventually that time will add up to something. Is this being offset by anything else, such as starting your wireless connection after boot?
I boot my machine at least once everyday, and often twice a day. After disabling NetworkManager-wait-online.service it's just faster. At least that's what I feel, it'll be more accurate measuring something like the time it takes from pressing the power button to opening the browser and finishing loading a webpage.
jglen490

Re: Upgrading HDD to SSD but boot is still slower than expected

Post by jglen490 »

Nesbit wrote:
ColdBootII wrote:I don't wish to necro-bump the thread, just wanted to say, this service started eating boot time since the last update to network manager gnome package in May. As it seems to affect many Mint machines perhaps it should be bug reported.
As suggested I have reported it as a bug ;)
jglen490 wrote:It's good that you are on your way to shaving 17 or so seconds off an already decent boot time. I'm not sure how often you actually boot your machine, but eventually that time will add up to something. Is this being offset by anything else, such as starting your wireless connection after boot?
I boot my machine at least once everyday, and often twice a day. After disabling NetworkManager-wait-online.service it's just faster. At least that's what I feel, it'll be more accurate measuring something like the time it takes from pressing the power button to opening the browser and finishing loading a webpage.
As a comparative metric, booting and loading a webpage is probably not very descriptive. What's important is how much time is used until the computer is ready to do useful work, whether booting to a command line or to a GUI login. From that point, there are just too many variables as to what defines useful work for a user, so booting to a login point is more consistently measurable and comparable.

I usually don't reboot more than about once a month. It's not that I'm into who has the best uptime, but rather I'd just rather sit down and do something; and paying for the electricity is just a part of the cost of doing "business". In my case it's not actual economic business but rather the business of looking at the world beyond the view outside my window.
ColdBootII

Re: Upgrading HDD to SSD but boot is still slower than expected

Post by ColdBootII »

jglen490 wrote: I usually don't reboot more than about once a month. It's not that I'm into who has the best uptime, but rather I'd just rather sit down and do something; and paying for the electricity is just a part of the cost of doing "business". In my case it's not actual economic business but rather the business of looking at the world beyond the view outside my window.
Yes, however when you eventually do a shutdown or reboot after kernel update you may notice that it takes 2 minutes to do so off a SSD. I've disabled the service when it slowly reached 9s (booting every day) as it seemed unnatural to wait 30s when only a week ago it took 20 (form power on to working desktop) on the same hardware and OS setup.
Nesbit wrote: As suggested I have reported it as a bug ;)
Nesbit, would you kindly point me to your bug report? I'd like to chip in so the devs don't regard it as some isolated case?
Nesbit

Re: Upgrading HDD to SSD but boot is still slower than expected

Post by Nesbit »

ColdBootII wrote: Nesbit, would you kindly point me to your bug report? I'd like to chip in so the devs don't regard it as some isolated case?
Yes please do that: https://bugs.launchpad.net/linuxmint/+bug/1722642
ColdBootII

Re: Upgrading HDD to SSD but boot is still slower than expected

Post by ColdBootII »

Nesbit wrote:
ColdBootII wrote: Nesbit, would you kindly point me to your bug report? I'd like to chip in so the devs don't regard it as some isolated case?
Yes please do that: https://bugs.launchpad.net/linuxmint/+bug/1722642
I just did.

To all other participants in the thread and all those affected by the same issue: please join in. We stand more chance to produce some traction from the devs, if you do. Disabling a potentially important system service may be a working solution but not a proper way to fix it. What if your network setting change and you find out that you cannot do without this service? So, something in Network Manager needs attention from the devs to be truly fixed. It won't take more than a minute of your time. :D
Nesbit

Re: Upgrading HDD to SSD but boot is still slower than expected

Post by Nesbit »

ColdBootII wrote:
Nesbit wrote:
ColdBootII wrote: Nesbit, would you kindly point me to your bug report? I'd like to chip in so the devs don't regard it as some isolated case?
Yes please do that: https://bugs.launchpad.net/linuxmint/+bug/1722642
I just did.

To all other participants in the thread and all those affected by the same issue: please join in. We stand more chance to produce some traction from the devs, if you do. Disabling a potentially important system service may be a working solution but not a proper way to fix it. What if your network setting change and you find out that you cannot do without this service? So, something in Network Manager needs attention from the devs to be truly fixed. It won't take more than a minute of your time. :D
Thanks. I've seen your comment, and I'm impressed by the boot time of your machine:
Startup finished in 3.052s (kernel) + 1.899s (userspace) = 4.952s
which is comparable to a Mac. Could you share the configuration of your machine? And how is it possible that you can skip the 'loader' phase? :shock:
Locked

Return to “Installation & Boot”