You are not logged in.

#1 2013-09-07 09:58:15

eaglclaws
Member
Registered: 2013-09-06
Posts: 7

Arch linux slow boot time

Hello, I'm a teen for South Korea using Xfce on a 32bit Arch system. Lately my boot speed has been severely reduced. I am unable to grasp the cause of this reduction and I would like some help. I have been searching for a solution for a few weeks with no positive results.

Here is the output of "systemd-analyze blame

%systemd-analyze blame
          1.767s dev-mqueue.mount
          1.767s sys-kernel-debug.mount
          1.766s systemd-tmpfiles-setup-dev.service
          1.766s dev-hugepages.mount
          1.748s tmp.mount
          1.631s systemd-remount-fs.service
          1.567s sys-kernel-config.mount
          1.566s systemd-vconsole-setup.service
          1.212s systemd-fsck@dev-disk-by\x2duuid-15e066cd\x2decb0\x2d4463\x2d8d89\x2d709a7a74a529.service
          1.082s home.mount
           661ms netctl@ethernet\x2ddhcp.service
           661ms systemd-udev-trigger.service
           515ms systemd-sysctl.service
           479ms systemd-tmpfiles-clean.service
           368ms systemd-logind.service
           232ms polkit.service
           207ms home-joe-shared.mount
           159ms systemd-random-seed-load.service
           138ms systemd-readahead-replay.service
            51ms systemd-readahead-collect.service
            45ms haveged.service
            33ms alsa-restore.service
            27ms systemd-update-utmp.service
            25ms systemd-readahead-done.service
            24ms systemd-tmpfiles-setup.service
            22ms rtkit-daemon.service
             9ms upower.service
             4ms systemd-journal-flush.service
             4ms systemd-udevd.service
             3ms systemd-user-sessions.service
             3ms ntpd.service

And the output of systemd-analyze time

%systemd-analyze time             
Startup finished in 3.540s (kernel) + 1min 36.330s (userspace) = 1min 39.870s

Offline

#2 2013-09-07 10:05:52

karol
Archivist
Registered: 2009-05-06
Posts: 25,440

Re: Arch linux slow boot time

Check the journal.
Remove 'quiet' from the kernel command line, disable plymouth etc. and see at what point does it "hang".

Offline

#3 2013-09-07 11:12:30

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,097

Re: Arch linux slow boot time

systemd-analyze plot  will tell you what is really slowing the boot down.

Last edited by Mr.Elendig (2013-09-07 11:13:57)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#4 2013-09-07 12:10:55

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,571
Website

Re: Arch linux slow boot time

I suspect the missing time is in the initramfs, this could be seen by the plot suggested above, and/or by including timestamp in mkinitcpio.conf and rebuilding the initramfs.  The former would be much simpler for a one-off check, but the latter is handy to regularly get a better breakdown of the information from `systemd-analyze`.

It seems your .mount services seem to take a bit longer than is common too.  Do you know if these have always taken ~1.7s each.  These will vary on different hardware, but that seems like it might be outside the normal range.

Certainly the .mount services are not the main issue here, but I wonder if they are another symptom of the underlying cause which might point to disk hardware or disk/filesystem module issues.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#5 2013-09-08 10:38:13

eaglclaws
Member
Registered: 2013-09-06
Posts: 7

Re: Arch linux slow boot time

This is what I got from systemd-analyze plot.
SppNJXpl.png
(I've read the forum etiquette page, but this was the best I could do with the image.)
About the .mount services, they have always taken less than 1s until a few weeks ago.

I don't know if this is important, but I did install Debian alongside Arch. I have /home on a separate partition, and I configured Debian(Crunchbang) to share /home with Arch, then shortly after Arch started to boot slower. Maybe there were conflicts between Debian and Arch?

Last edited by eaglclaws (2013-09-08 10:41:49)

Offline

#6 2013-09-08 11:31:04

Mr.Elendig
#archlinux@freenode channel op
From: The intertubes
Registered: 2004-11-07
Posts: 4,097

Re: Arch linux slow boot time

Sharing .files when the two distroes has vastly different versions of applications is generally a bad idea. Btw, Crunchbang is not debian, just like Manjaro is not archlinux etc.

Is that the complete plot btw? It does look really strange.

Last edited by Mr.Elendig (2013-09-08 11:31:44)


Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest

Offline

#7 2013-09-08 11:52:20

Grant
Member
From: Italy
Registered: 2012-12-15
Posts: 246

Re: Arch linux slow boot time

Are you using the same user for both Debian and Arch? I had some trouble in the past with a shared user. Infact, it seems you are loading something else during the boot, because the services that you load cannot explain all that userspace time.
You may try to make a new user, and see if the boot is still slow.

Offline

#8 2013-09-09 10:11:35

eaglclaws
Member
Registered: 2013-09-06
Posts: 7

Re: Arch linux slow boot time

I am using different users on Crunchbang and Arch and both distros use separate home folders.
When I remove 'quiet' from the kernel line and boot, I notice the system takes a long time to finish one particular job. It says :

A start job is running for dev-disk-by\x2duuid-0349a1d5\x2d7f09\x2d49d7\x2d93f8\x2d00d542d424a0.device

But the strange thing is that I have no disk that goes by said uuid. This job isn't even recorded on systemd-analyze.

Last edited by eaglclaws (2013-09-09 10:18:00)

Offline

#9 2013-09-09 10:23:15

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,571
Website

Re: Arch linux slow boot time

Could that be in your bootloader?


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2013-09-13 07:32:53

eaglclaws
Member
Registered: 2013-09-06
Posts: 7

Re: Arch linux slow boot time

Sorry for the long delay, I was short on time for a few days. I ran journalctl -xn right after I got home from school, and I got this:

-- Logs begin at Mon 2013-06-10 20:57:24 KST, end at Fri 2013-09-13 16:20:40 KST. --
Sep 13 16:20:02 argon systemd[1]: Job dev-disk-by\x2duuid-0349a1d5\x2d7f09\x2d49d7\x2d93f8\x2d00d542d424a0.device/start timed out.
Sep 13 16:20:02 argon systemd[1]: Timed out waiting for device dev-disk-by\x2duuid-0349a1d5\x2d7f09\x2d49d7\x2d93f8\x2d00d542d424a0.device.
-- Subject: Unit dev-disk-by\x2duuid-0349a1d5\x2d7f09\x2d49d7\x2d93f8\x2d00d542d424a0.device has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02cf6855d2428ba40df7e9d022f03d
-- 
-- Unit dev-disk-by\x2duuid-0349a1d5\x2d7f09\x2d49d7\x2d93f8\x2d00d542d424a0.device has failed.
-- 
-- The result is timeout.
Sep 13 16:20:02 argon systemd[1]: Dependency failed for /dev/disk/by-uuid/0349a1d5-7f09-49d7-93f8-00d542d424a0.
-- Subject: Unit dev-disk-by\x2duuid-0349a1d5\x2d7f09\x2d49d7\x2d93f8\x2d00d542d424a0.swap has failed
-- Defined-By: systemd
-- Support: http://lists.freedesktop.org/mailman/listinfo/systemd-devel
-- Documentation: http://www.freedesktop.org/wiki/Software/systemd/catalog/be02cf6855d2428ba40df7e9d022f03d
-- 
-- Unit dev-disk-by\x2duuid-0349a1d5\x2d7f09\x2d49d7\x2d93f8\x2d00d542d424a0.swap has failed.
-- 
-- The result is dependency.
Sep 13 16:20:17 argon sudo[2365]: joe : TTY=pts/0 ; PWD=/home/joe ; USER=root ; COMMAND=/usr/bin/journalctl -x
Sep 13 16:20:17 argon sudo[2365]: pam_unix(sudo:session): session opened for user root by joe(uid=0)
Sep 13 16:20:39 argon sudo[2365]: pam_unix(sudo:session): session closed for user root
Sep 13 16:20:40 argon sudo[2567]: joe : TTY=pts/0 ; PWD=/home/joe ; USER=root ; COMMAND=/usr/bin/journalctl -xn
Sep 13 16:20:40 argon sudo[2567]: pam_unix(sudo:session): session opened for user root by joe(uid=0)

Could it be a faulty driver that's causing this problem?

Offline

#11 2013-09-14 07:45:06

eaglclaws
Member
Registered: 2013-09-06
Posts: 7

Re: Arch linux slow boot time

I think I have found a solution to the uuid problem. Arch was looking for a uuid that did not exist. While installing Crunchbang swap must have been assigned a new uuid. So I edited my fstab to match the current uuid and then I got this

systemd-analyze time

Startup finished in 712ms (kernel) + 2.784s (initrd) + 26.329s (userspace) = 29.827s

This is a big improvement to the boot time. However, It seems mounting still takes a while to get done.

systemd-analyze blame

          17.057s netctl@ethernet\x2ddhcp.service
          1.280s home.mount
          1.153s systemd-remount-fs.service
          1.144s dev-hugepages.mount
          1.135s dev-mqueue.mount
          1.115s tmp.mount
          1.105s sys-kernel-debug.mount
          1.077s systemd-udev-trigger.service
          1.061s systemd-tmpfiles-setup-dev.service
           979ms sys-kernel-config.mount
           844ms systemd-fsck@dev-disk-by\x2duuid-15e066cd\x2decb0\x2d4463\x2d8d89\x2d709a7a74a529.service
           455ms systemd-vconsole-setup.service
           393ms systemd-sysctl.service
           317ms systemd-logind.service
           260ms ntpd.service
           185ms home-joe-shared.mount
           115ms systemd-readahead-replay.service
            70ms rtkit-daemon.service
            60ms systemd-readahead-collect.service
            40ms haveged.service
            39ms dev-disk-by\x2duuid-67d4c53f\x2dfd5c\x2d4784\x2daa95\x2d34470493bc69.swap
            32ms alsa-restore.service
            30ms systemd-random-seed-load.service
            27ms polkit.service
            23ms systemd-tmpfiles-setup.service
            16ms systemd-udevd.service
             6ms upower.service
             5ms systemd-journal-flush.service
             4ms systemd-user-sessions.service
             3ms systemd-update-utmp.service
             2ms systemd-readahead-done.service

Last edited by eaglclaws (2013-09-14 07:47:08)

Offline

#12 2013-09-14 15:19:49

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: Arch linux slow boot time

Some of my mount times are similar or higher - they range between about 400ms and 1.7s - so I'm not sure the times you are seeing are really beyond the normal range.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#13 2013-09-14 15:42:56

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Arch linux slow boot time

Wait a minute… your mount units are taking ≤1.2s, and are presumably being parallelized as much as possible.  But your netctl time is 17.057s!  It would seem to me that the greater concern here should not be the mounts so much finding a way to use netctl that doesn't block the system from reaching the multi-user.target (or beyond).

Don't get me wrong, netctl is awesome and I really do like it.  But it would seem as though you are using just a simple wired connection.  So if the time it takes for your current netctl@ethernet\x2ddhcp is not an issue, I would probably suggest trying to simplify things and using just the basic dhcpcd@<interface>.service.

But the question here is boot time.  So I think that if you want to stick with netctl, you should use the ifplug compatibility so that the unit can start and report success before a full connectable IP is resolved.  So try disabling the current unit you are using (either with the netctl CLI interface or systemctl).  Then enable the netctl-ifplug thing instead (ie. systemctl enable netctl-ifplugd@<interface>.service). 

The netctl-ifplugd@.service should take just a couple seconds to get itself going, and after it has loaded the ethernet-dhcp profile, it will report success, and your boot will continue.  When you reach the desktop, you likely won't have a working network connection for a few moments.  This is because the netctl-ifplugd@.service will likely still take a similar amount of time to actually resolve the IP, but this portion will just not be reported as part of your overall boot time.

Alternatively, you could use something like wicd, connman, or network-manager.  But those might be overkill for what you have going there (as in, no wireless or raoming, etc).  You should also be aware that NetworkManager is shipped with a service called NetworkManager-wait-online.service, and what that does is… unsurprisingly, wait until you are online before reposting success.  So this unit is pulled in automatically by NetworkManager.service and will delay your boot in the same way as it is now.  So when I use NetworkManager, I just mask the service.

Offline

#14 2013-09-14 15:51:55

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: Arch linux slow boot time

I don't think wicd would necessarily speed things up anyway - it takes almost 16s according to systemd-analyze on my machine. However, I'm using a more complex network connection - that start time is for an encrypted wireless connection (probably my home lan but possibly eduroam).


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#15 2013-09-14 20:24:23

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Arch linux slow boot time

Wicd does take a bit mroe time to actually initiate a connection.  But in terms of getting to a usable graphical environment, I find that it is one of the fastest to actually load its service and let things move on.  I just enabled the service and rebooted, so that I can show you.  But keep in mind that this is a machine with a Samsung 840 250GB as its primary drive (the secondary being a Samsung 830, which holds the ESP).

systemd-analyze blame wrote:

<snip>
384ms wicd.service
<snip>

Offline

#16 2013-09-14 20:39:02

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: Arch linux slow boot time

$ systemd-analyze blame | grep wicd
         15.962s wicd.service

But I don't have an SSD so obviously it will take longer here.

Not that this especially bothers me one way or another. Just it is actually the third slowest service listed by systemd-analyze blame for me.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#17 2013-09-14 21:22:01

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Arch linux slow boot time

3rd?  The network management startup is consistently the slowest on my machine.  This is irrespective of whether I use netctl-auto, wicd, connman, or NetworkManager (I know I'm a network manager whore).  I'm curious what the two slower startups are on your list there?

Offline

#18 2013-09-14 22:48:22

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: Arch linux slow boot time

clamd is consistently and by far the slowest service. avahi-daemon is slightly slower than wicd (at least on this boot).

$ systemd-analyze blame
         28.767s clamd.service
         16.007s avahi-daemon.service
         15.962s wicd.service
...

CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#19 2013-09-14 23:21:43

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,571
Website

Re: Arch linux slow boot time

For the OPs issue, changing fixing the swap UUID seems to have rememdied everything that looks problematic.

OP, do you feel there is still an issue?  I originally thought ~1.7s mount times were not *outside* a normal range, but high enough in the normal range to take closer look at them.  But in your output after fixing the UUID, the mount times are all ~1s.  Perhaps you want even faster, but this seems perfectly within a normal range for a HDD.

Getting your network connection is taking a while, but I don't know that this is a 'problem'.  This can take some time depending on many factors, and - if things are working properly - establishing a network connection should not prevent your desktop from starting.  So while systemd analyze may get a long total time, you are probably to an effectively fully booted system well before that time.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#20 2013-09-16 10:33:10

eaglclaws
Member
Registered: 2013-09-06
Posts: 7

Re: Arch linux slow boot time

I am happy to hear that my mount times aren't abnormal. Sometimes home.mount takes about 10+ seconds, but only rarely, so I can say my overall problem has been solved. Thank you for your assistance and I hope others can find solutions to their problems too.

Offline

#21 2013-09-16 20:55:19

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: Arch linux slow boot time

10+ seconds is definitely abnormal. Or is this after an unclean shutdown and it includes replaying the journal or something?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#22 2013-09-16 21:46:33

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,571
Website

Re: Arch linux slow boot time

I can imagine 10 seconds for the periodic fsck on a large partition on a spinning disk.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#23 2013-09-16 22:12:12

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,198

Re: Arch linux slow boot time

fsck gets separate times in my listing so I wasn't sure whether that would be included in the mount time as well?


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#24 2013-09-16 23:13:10

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,414

Re: Arch linux slow boot time

Since it would seem like a 10 second /home mount time would likely be one of the slower things, and something the rest of the system would end up waiting for, you can try using systemd-analyze critical-chain to see if it is just sitting waiting for something else for most of it initialization time.  If it is, then it is probably the fsck it is waiting for. 

Of course, you could always look at your journal to see if there are any obvious issues during that time period.

Offline

#25 2013-09-17 10:13:03

eaglclaws
Member
Registered: 2013-09-06
Posts: 7

Re: Arch linux slow boot time

It's strange, critical-chain and the journal don't seem to have any information on home mount other than it is being mounted. I'm using Readahead, maybe that is partly causing this, the wiki said it would have varied effects. I'll try disabling Readahead and see the results.

-UPDATE-

It seems readahead was causing the slow home mount, disabling readahead made home.mount drop to 334ms.

Last edited by eaglclaws (2013-09-17 10:22:34)

Offline

Board footer

Powered by FluxBB