You are not logged in.

#1 2022-03-31 14:04:09

tyson_the_13th
Member
Registered: 2022-03-31
Posts: 9

[SOLVED] Slow Boot Time

Machine : Alienware X15 R2 Laptop
CPU : Intel i7-12700H
GPU : integrated intel graphics and NVIDIA GeForce RTX 3070ti
Dual-booting in Windows 11 and Arch Linux

Hello, guys! I have recently installed Arch and have been downloading packages and uninstalling them to solve NVIDIA driver issues. I'm not sure what I have touched, but it seems that I have been getting very long boot times since last couple of days and I cannot find out why.

uname -a
Linux Arch 5.17.1-arch1-1 #1 SMP PREEMPT Mon, 28 Mar 2022 20:55:33 +0000 x86_64 GNU/Linux

Output of Systemd-analyze:

  • systemd-analyze
    Startup finished in 8.075s (firmware) + 3.495s (loader) + 1.414s (kernel) + 1min 30.309s (userspace) = 1min 43.295s 
    graphical.target reached after 1min 30.309s in userspace
  • systemd-analyze critical-chain
    The time when unit became active or started is printed after the "@" character.
    The time the unit took to start is printed after the "+" character.
    
    graphical.target @1min 30.309s
    └─multi-user.target @1min 30.309s
      └─getty.target @1min 30.309s
        └─getty@tty1.service @1min 30.308s
          └─systemd-user-sessions.service @1min 30.302s +4ms
            └─network.target @1min 30.300s
              └─iwd.service @3.209s +385ms
                └─basic.target @3.207s
                  └─sockets.target @3.207s
                    └─dbus.socket @3.207s
                      └─sysinit.target @3.207s
                        └─systemd-backlight@backlight:nvidia_wmi_ec_backlight.service @6.7>
                          └─system-systemd\x2dbacklight.slice @6.356s
                            └─system.slice @128ms
                              └─-.slice @128ms
  • systemd-analyze blame
    1.651s dev-nvme0n1p4.device
    1.327s efi.mount
     642ms systemd-rfkill.service
     385ms iwd.service
      87ms systemd-journal-flush.service
      71ms user@1000.service
      69ms systemd-networkd.service
      40ms systemd-udev-trigger.service
      24ms systemd-resolved.service
      23ms systemd-tmpfiles-clean.service
      19ms systemd-journald.service
      18ms systemd-udevd.service
      16ms dhcpcd.service
      12ms systemd-logind.service
      11ms systemd-tmpfiles-setup.service
       9ms dev-hugepages.mount
       8ms dev-mqueue.mount
       8ms sys-kernel-debug.mount
       8ms systemd-tmpfiles-setup-dev.service
       8ms sys-kernel-tracing.mount

It seems that systemd-user-sessions.service is the one that takes more than a minute. I have found out that in the manpage systemd-user-sessions is used to control logins, permitting them after booting and disabling them before system shutdown. I thought of disabling this service to see if it reduces the boot time but it doesn't seem to be disabled by:

sudo systemctl disable systemd-user-sessions.service

It still gives me the same long boot time and I could still see it in

systemd-analyze critical-chain

after reboot.

What could I be missing here and could this problem be something unrelated to systemd-user-sessions.service at all?

Last edited by tyson_the_13th (2022-04-04 00:30:28)

Offline

#2 2022-03-31 14:22:05

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,705

Re: [SOLVED] Slow Boot Time

        └─network.target @1min 30.300s
          └─iwd.service @3.209s +385ms

Network related, please post a complete system journal ("sudo journalctl -b") and the output of

find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f

You can use the tip from the 1st link below - don't copy and paste out of the terminal (pager)

Offline

#3 2022-03-31 19:13:58

darnrain
Member
Registered: 2019-05-18
Posts: 3

Re: [SOLVED] Slow Boot Time

I had the same issue two days ago, it turns out it was the new mesa update v22.0.0 downgrade to 21.3.7 that should fix the slow boot time.

Last edited by darnrain (2022-03-31 19:35:14)

Offline

#4 2022-03-31 19:48:57

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 25,285

Re: [SOLVED] Slow Boot Time

the only way this can be generally true if you have too old HW that is actually dropped from normal mesa and mesa-amber being broken (other than shader recompilation but that will be a one time hit that can happen every time mesa updates). We have pretty strong evidence here that this isn't the case but rather a problem in the network stack

Offline

#5 2022-04-01 23:45:03

tyson_the_13th
Member
Registered: 2022-03-31
Posts: 9

Re: [SOLVED] Slow Boot Time

Update:

seth wrote:

Network related, please post a complete system journal ("sudo journalctl -b") and the output of

find /etc/systemd -type l -exec test -f {} \; -print | awk -F'/' '{ printf ("%-40s | %s\n", $(NF-0), $(NF-1)) }' | sort -f

As for mesa, as the two other comments suggested:

sudo pacman -Q mesa

Output :

mesa 22.0.0-1

I have tried downgrading mesa, which did not fix boot time and made my wifi card undetectable. I upgraded back to latest mesa and wifi is working now.

One thing I noticed is that when I had no wifi connection after downgrading mesa, I had to connect to ethernet and when my laptop was connected to the ethernet, the boot time was extremely reduced.
Output of systemd-analyze when ethernet cable is connected.

I have installed Arch using a live USB and installed the packages while I was connected to an ethernet cable.
Given that my laptop does not have an ethernet port, I used a network adapter that Dell provides to connect to the ethernet.

Do you guys see any potential problem that I might be doing wrong?

Offline

#6 2022-04-01 23:52:33

loqs
Member
Registered: 2014-03-06
Posts: 18,970

Re: [SOLVED] Slow Boot Time

dhcpcd.service                           | multi-user.target.wants
iwd.service                              | multi-user.target.wants
netctl@custom\x2ddhcp\x2dprofile.service | multi-user.target.wants
systemd-networkd.service                 | multi-user.target.wants

Multiple network management services conflict and commonly cause unexpected issues.  You need to pick one.
Edit:
iwd may not conflict it depends if you have configured it to perform DHCP itself.
Edit2:

Apr 01 10:28:26 Arch dhcpcd[528]: wlan0: no IPv6 Routers available
Apr 01 10:29:38 Arch systemd[1]: sys-subsystem-net-devices-wwp0s13f0u1c2.device: Job sys-subsystem-net-devices-wwp0s13f0u1c2.device/start timed out.
Apr 01 10:29:38 Arch systemd[1]: Timed out waiting for device /sys/subsystem/net/devices/wwp0s13f0u1c2.
Apr 01 10:29:38 Arch systemd[1]: Dependency failed for A basic dhcp ethernet connection.
Apr 01 10:29:38 Arch systemd[1]: netctl@custom\x2ddhcp\x2dprofile.service: Job netctl@custom\x2ddhcp\x2dprofile.service/start failed with result 'dependency'.
Apr 01 10:29:38 Arch systemd[1]: sys-subsystem-net-devices-wwp0s13f0u1c2.device: Job sys-subsystem-net-devices-wwp0s13f0u1c2.device/start failed with result 'timeout'.
Apr 01 10:29:38 Arch systemd[1]: Reached target Network.

There goes 12 seconds waiting for a missing wireless NIC.

Last edited by loqs (2022-04-02 00:02:02)

Offline

#7 2022-04-02 00:07:29

tyson_the_13th
Member
Registered: 2022-03-31
Posts: 9

Re: [SOLVED] Slow Boot Time

loqs wrote:

iwd may not conflict it depends if you have configured it to perform DHCP itself.

I believe I have made for myself a file under /etc/systemd/network/20-wired.network

[Match]
Name=wwp*
Name=en*
NAme=eth*

[Network]
DHCP=yes

I am not sure if this action is considered "configuring DHCP myself". The reason I did this is because without this file, I could not connect to the ethernet after I first installed Arch in my partition and booted into it. I needed this file to connect to the ethernet and download additional packages.

Is this considered "configuring DHCP myself" and is there a better workaround for this?

Offline

#8 2022-04-02 07:06:52

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 76,705

Re: [SOLVED] Slow Boot Time

not sure if this action is considered "configuring DHCP myself"

No, that enables dhcp for systemd-networkd
https://wiki.archlinux.org/title/Iwd#En … figuration

is there a better workaround for this?

There's no workaround required.
You need to pick *one* network managing service - when you made up your mind which one's that gonna be, disable all others and configure the chosen one to work.
If you struggle w/ that, ask back - but *you* must decide which service suits you best.

From the journal, you seem to only have a wifi interface, so just iwd would actually suffice.

Offline

#9 2022-04-02 16:13:23

tyson_the_13th
Member
Registered: 2022-03-31
Posts: 9

Re: [SOLVED] Slow Boot Time

seth wrote:

If you struggle w/ that, ask back - but *you* must decide which service suits you best.

Would disabling other services be as simple as running the following command:

sudo systemctl disable service_to_be_disabled

As you have said, I'm thinking of using iwd only. In this case, is it true that I would need to disable:

  • dhcpcd.service

  • netctl@custom\x2ddhcp\x2dprofile.service

  • systemd-networkd.service

Are there services from the above list that I should not disable?

Offline

#10 2022-04-04 00:29:10

tyson_the_13th
Member
Registered: 2022-03-31
Posts: 9

Re: [SOLVED] Slow Boot Time

I solved it by disabling services that I don't use.

sudo systemctl disable dhcpcd.service
sudo systemctl disable netctl@custom\x2ddhcp\x2dprofile.service 

Disabling the systemd-networkd.service prevented me from connecting to the internet even when I was connected to a wifi so I kept it there.

Now the system boots in 9 seconds. Thank you so much for those who helped!

Offline

Board footer

Powered by FluxBB