Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Slow boot time before & after login (SDDM, KDE)

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
Protema
Posts: 7
Joined: 2018-08-21 17:38

Slow boot time before & after login (SDDM, KDE)

#1 Post by Protema »

Hello,
I installed Debian 9.5 on a friend's laptop, with an AMD E1-2500 and 4GB ram.
She never used GNU/Linux before so I choose KDE and now I try to make it more eyecandy.

The problem... the boot is very slow.
There is ~13 seconds between plymouth and SDDM and I'm able to briefly see the tty1 login prompt; when I enter the password KSplash stays for ~35 seconds, then I still have to wait ~15 seconds to see the desktop fully loaded.
I tried a few things:
* install haveged
* tick the "start an empty session" option
* disable the "update search folder" service

Akonadi is running (checked with "akonadictl status") but I don't know what starts it, the digital clock doesn't have an option to disable events like described here.
I even tried to disable KSplash but it doesn't change anything.

Can you give me some advice? Thanks :)

L_V
Posts: 1477
Joined: 2007-03-19 09:04
Been thanked: 11 times

Re: Slow boot time before & after login (SDDM, KDE)

#2 Post by L_V »

Can you check these outputs ?

Code: Select all

systemd-analyze blame
systemd-analyze critical-chain
Concerning sddm, a new haveged dependency has been added (although only a sddm recommended dependency) / not very clear.

/lib/systemd/system/sddm.service

Code: Select all

[Unit]
Description=Simple Desktop Display Manager
After=systemd-user-sessions.service systemd-logind.service
# Workaround entropy starvation
After=haveged.service

Protema
Posts: 7
Joined: 2018-08-21 17:38

Re: Slow boot time before & after login (SDDM, KDE)

#3 Post by Protema »

I tried to add "After=haveged.service" but I don't see a change. But the previous line is "After=systemd-user-sessions.service" without "systemd-logind.service", is it useful?

Code: Select all

$ systemd-analyze blame
          5.522s dev-sda3.device
          3.777s packagekit.service
          3.724s NetworkManager.service
          3.527s systemd-fsck@dev-disk-by\x2duuid-8F2C\x2d9A1D.service
          2.668s ModemManager.service
          2.286s networking.service
          2.192s accounts-daemon.service
          1.476s systemd-rfkill.service
          1.317s avahi-daemon.service
          1.242s rsyslog.service
          1.163s keyboard-setup.service
          1.134s systemd-modules-load.service
           805ms systemd-tmpfiles-setup-dev.service
           801ms speech-dispatcher.service
           718ms dev-sda4.swap
           678ms systemd-udevd.service
           661ms systemd-remount-fs.service
           648ms upower.service
           645ms dev-hugepages.mount
           627ms dev-mqueue.mount
           622ms sys-kernel-debug.mount
           622ms polkit.service
           535ms systemd-logind.service
           519ms systemd-timesyncd.service
           491ms gdomap.service
           476ms rtkit-daemon.service
           444ms bluetooth.service
           434ms wpa_supplicant.service
           404ms systemd-journald.service
           383ms pppd-dns.service
           308ms systemd-tmpfiles-setup.service
           266ms kmod-static-nodes.service
           256ms systemd-backlight@backlight:radeon_bl0.service
           247ms console-setup.service
           199ms systemd-udev-trigger.service
           179ms systemd-journal-flush.service
           163ms plymouth-quit-wait.service
           161ms sddm.service
           160ms plymouth-quit.service
           158ms user@113.service
           155ms boot-efi.mount
           133ms udisks2.service
           133ms plymouth-start.service
           122ms systemd-update-utmp.service
           112ms systemd-random-seed.service
            90ms systemd-sysctl.service
            65ms user@1000.service
            57ms plymouth-read-write.service
            38ms alsa-restore.service
            26ms systemd-user-sessions.service
            23ms systemd-update-utmp-runlevel.service

Code: Select all

$ systemd-analyze critical-chain 
The time after the unit is active or started is printed after the "@" character.
The time the unit takes to start is printed after the "+" character.

graphical.target @15.984s
└─multi-user.target @15.983s
  └─getty.target @15.983s
    └─getty@tty1.service @15.979s
      └─systemd-user-sessions.service @15.757s +26ms
        └─network.target @15.755s
          └─NetworkManager.service @12.030s +3.724s
            └─dbus.service @11.062s
              └─basic.target @11.060s
                └─paths.target @11.060s
                  └─cups.path @11.060s
                    └─sysinit.target @11.029s
                      └─systemd-timesyncd.service @10.509s +519ms
                        └─systemd-tmpfiles-setup.service @10.168s +308ms
                          └─local-fs.target @10.165s
                            └─boot-efi.mount @10.007s +155ms
                              └─systemd-fsck@dev-disk-by\x2duuid-8F2C\x2d9A1D.service @6
                                └─dev-disk-by\x2duuid-8F2C\x2d9A1D.device @6.441s
The boot itself seems pretty good, I checked with the generated plot and sddm.service is started before getty@tty1.service.
I checked /var/log/Xorg.0.log and there is something interesting at the end:

Code: Select all

[    25.569] (--) Log file renamed from "/var/log/Xorg.pid-520.log" to "/var/log/Xorg.0.log"
[    25.592]
X.Org X Server 1.19.2
Release Date: 2017-03-02
[    25.592] X Protocol Version 11, Revision 0
[    25.592] Build Operating System: Linux 4.9.0-4-amd64 x86_64 Debian

...

[    30.110] (II) input device 'Acer WMI hotkeys', /dev/input/event12 is tagged by udev as: Keyboard
[    30.110] (II) input device 'Acer WMI hotkeys', /dev/input/event12 is a keyboard
[    30.111] (II) config/udev: Adding input device Acer BMA150 accelerometer (/dev/input/event13)
[    30.111] (II) No input driver specified, ignoring this device.
[    30.111] (II) This device may have been added with another device file.
[    30.111] (II) config/udev: Adding input device Acer BMA150 accelerometer (/dev/input/js0)
[    30.112] (II) No input driver specified, ignoring this device.
[    30.112] (II) This device may have been added with another device file.
[    52.417] (II) RADEON(0): EDID vendor "LGD", prod id 1276
[    52.417] (II) RADEON(0): Printing DDC gathered Modelines:
[    52.417] (II) RADEON(0): Modeline "1366x768"x0.0   76.32  1366 1414 1446 1610  768 771 776 790 -hsync -vsync (47.4 kHz eP)
[    58.593] (II) RADEON(0): EDID vendor "LGD", prod id 1276
[    61.473] (II) RADEON(0): Printing DDC gathered Modelines:
[    61.473] (II) RADEON(0): Modeline "1366x768"x0.0   76.32  1366 1414 1446 1610  768 771 776 790 -hsync -vsync (47.4 kHz eP)
There is a 12 seconds gap which I believe is what I have to wait.
By the way, I have installed the firmware-linux-nonfree package to have hardware acceleration, but the issue was the same before.

L_V
Posts: 1477
Joined: 2007-03-19 09:04
Been thanked: 11 times

Re: Slow boot time before & after login (SDDM, KDE)

#4 Post by L_V »

Difficult to compare because your sda is probably a hard-disk, and not SDD.
On Stretch, with fewer services, this is what I get:

Code: Select all

# systemd-analyze
           Startup finished in 2.262s (kernel) + 1.487s (userspace) = 3.750s

# systemd-analyze blame
           495ms networking.service 
           337ms accounts-daemon.service 
           326ms dev-sda3.device 
           194ms keyboard-setup.service 
           190ms systemd-fsck@dev-disk-by\x2duuid-8359cdfe\x2d09bc\x2d4dee\x2daaf6\x2d8b3cc1c986b1.service 
           169ms lm-sensors.service 
           153ms rsyslog.service 
           152ms alsa-restore.service 
           144ms udisks2.service 
           122ms systemd-networkd.service 
            93ms dev-disk-by\x2duuid-9b683fee\x2dc434\x2d45a2\x2dae49\x2dfd031266bed5.swap 
On Buster, udisks2 service is slowing down, but Buster is testing (with may be some kernel debug)

Code: Select all

# systemd-analyze
          Startup finished in 3.086s (kernel) + 1.812s (userspace) = 4.898s
          graphical.target reached after 1.799s in userspace

# systemd-analyze blame
           637ms udisks2.service
           492ms dev-sda3.device
           310ms NetworkManager.service
           204ms systemd-logind.service
           201ms wpa_supplicant.service
           181ms chrony.service
           167ms systemd-modules-load.service
           154ms user@1000.service
           153ms systemd-fsck@dev-disk-by\x2dlabel-sdsk\x2dextra.service
           135ms networking.service
           131ms systemd-journald.service
           119ms systemd-tmpfiles-setup.service
           100ms systemd-fsck@dev-disk-by\x2duuid-94d6fb2f\x2d59c1\x2d4ca5\x2db6db\x2df74db75cc29d.service
            95ms systemd-udev-trigger.service
            63ms console-setup.service
            59ms systemd-udevd.service
            58ms mnt-extra.mount
            45ms dev-disk-by\x2duuid-87c8a2ed\x2dacba\x2d461e\x2d86b5\x2d51462de144ba.swap
+ don't know what is your "device Acer BMA150 accelerometer", but it does not seem to be a problem.
To disable a service .... with care / example: rsyslog.....:

Code: Select all

sudo systemctl disable xxxxxx.service

Protema
Posts: 7
Joined: 2018-08-21 17:38

Re: Slow boot time before & after login (SDDM, KDE)

#5 Post by Protema »

This is definitely a hard disk, that's why the boot time seems correct to me.
Now I'm pretty sure it is a Xorg issue since systemd starts SDDM at the end of the boot, after stopping plymouth. I was not talking about the accelerometer, but the Modeline just after; I was not able to get them on subsequent boots, but the time logged corresponds to what I have to wait to see SDDM.

L_V
Posts: 1477
Joined: 2007-03-19 09:04
Been thanked: 11 times

Re: Slow boot time before & after login (SDDM, KDE)

#6 Post by L_V »

Just to see:

Code: Select all

lspci -k | egrep -iA2 'vga|3d'
dpkg -l firmware* | grep '^i'

Protema
Posts: 7
Joined: 2018-08-21 17:38

Re: Slow boot time before & after login (SDDM, KDE)

#7 Post by Protema »

Here you go:

Code: Select all

$ lspci -k | egrep -iA2 'vga|3d'
00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Kabini [Radeon HD 8240 / R3 Series]
        Subsystem: Acer Incorporated [ALI] Kabini [Radeon HD 8240 / R3 Series]
        Kernel driver in use: radeon

Code: Select all

$ dpkg -l firmware* | grep '^i'
ii  firmware-amd-graphics  20161130-3   all          Binary firmware for AMD/ATI graphics chips
ii  firmware-linux-free    3.4          all          Binary firmware for various drivers in the Linux kernel
ii  firmware-linux-nonfree 20161130-3   all          Binary firmware for various drivers in the Linux kernel (meta-package)
ii  firmware-misc-nonfree  20161130-3   all          Binary firmware for various drivers in the Linux kernel
ii  firmware-realtek       20161130-3   all          Binary firmware for Realtek wired/wifi/BT adapters
I installed firmware-realtek because I saw a lot of "possible missing firmware /lib/firmware/rtl_nic" warnings.

Protema
Posts: 7
Joined: 2018-08-21 17:38

Re: Slow boot time before & after login (SDDM, KDE)

#8 Post by Protema »

Alright, I installed Kubuntu on a spare partition:
- systemd-analyze: 12s kernel + 35s user (losing some time on network-manager, might be able to fix it)
- after the splash logo to SDDM: 12s (adding haveged.service as "After" doesn't change anything)
- from the login to the desktop: 30s (the desktop appears just after KSplash stops)

Also it includes Qt 5.9 and KDE 5.12.


To compare with Debian, which includes Qt 5.7 and KDE 5.8:
- systemd-analyze: 10s kernel + 15s user
- after the splash logo to SDDM: 18s (adding haveged.service as "After" doesn't change anything)
- from the login to KSplash: 20s
- from KSplash to the desktop: 25s


I think I will install Kubuntu, it includes more up-to-date softwares (LibreOffice, Firefox), the integration with KDE is its aim and it's a LTS version :)

L_V
Posts: 1477
Joined: 2007-03-19 09:04
Been thanked: 11 times

Re: Slow boot time before & after login (SDDM, KDE)

#9 Post by L_V »

For info, Buster: Qt 5.11 / KDE 5.13 / Libreoffice 6.1 / Firefox-esr 60.1 from SID )
( I currently use Buster/SID ).
When Buster will be declared "stable" which should be before end 2019, I will lock sources.list to buster only.

ps: I don't understand how your network needs so much time to be enabled (less than 400ms for me, with a fixed IP).
Quite sure you can disable/avoid quite some stuff (plymouth ... Kpslash ... akonadi etc etc....)

Code: Select all

systemd-analyze
    Startup finished in 2.632s (kernel) + 1.555s (userspace) = 4.188s
    graphical.target reached after 1.531s in userspace
For info, I always make a netinstall to get something lighter.

User avatar
sunrat
Administrator
Administrator
Posts: 6497
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 118 times
Been thanked: 476 times

Re: Slow boot time before & after login (SDDM, KDE)

#10 Post by sunrat »

L_V wrote:For info, Buster: Qt 5.11 / KDE 5.13 / Libreoffice 6.1 / Firefox-esr 60.1 from SID )
( I currently use Buster/SID ).
Quite sure you can disable/avoid quite some stuff (plymouth ... Kpslash ... akonadi etc etc....)
+1. Akonadi is a huge waste of memory unless you use something from KDE PIM like Kmail. Disable it by editing
~/.config/akonadi/akonadiserverrc
Change

Code: Select all

StartServer=true
to

Code: Select all

StartServer=false
Last edited by sunrat on 2018-08-24 18:24, edited 1 time in total.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

milomak
Posts: 2168
Joined: 2009-06-09 22:20
Been thanked: 2 times

Re: Slow boot time before & after login (SDDM, KDE)

#11 Post by milomak »

sunrat wrote:
L_V wrote:For info, Buster: Qt 5.11 / KDE 5.13 / Libreoffice 6.1 / Firefox-esr 60.1 from SID )
( I currently use Buster/SID ).
Quite sure you can disable/avoid quite some stuff (plymouth ... Kpslash ... akonadi etc etc....)
+1. Akonadi is a huge waste of memory unless you use something from KDE PIM like Kmail. Disable it by editing
~/.config/akonadi/
Change

Code: Select all

StartServer=true
to

Code: Select all

StartServer=false
you've referenced a directory and not a file regarding what needs to be edited
Desktop: A320M-A PRO MAX, AMD Ryzen 5 3600, GALAX GeForce RTX™ 2060 Super EX (1-Click OC) - Sid, Win10, Arch Linux, Gentoo, Solus
Laptop: hp 250 G8 i3 11th Gen - Sid
Kodi: AMD Athlon 5150 APU w/Radeon HD 8400 - Sid

L_V
Posts: 1477
Joined: 2007-03-19 09:04
Been thanked: 11 times

Re: Slow boot time before & after login (SDDM, KDE)

#12 Post by L_V »

The file is ~/.config/akonadi/akonadiserverrc
StartServer=false

If no need of akonadi (no Kmail, no kdePIM, it is even better to not install akonadi.

Code: Select all

dpkg -l '*akonadi*'
=> nothing

User avatar
sunrat
Administrator
Administrator
Posts: 6497
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 118 times
Been thanked: 476 times

Re: Slow boot time before & after login (SDDM, KDE)

#13 Post by sunrat »

milomak wrote:you've referenced a directory and not a file regarding what needs to be edited
Oops, yeah edited to correct. L_V posted the right file.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

Protema
Posts: 7
Joined: 2018-08-21 17:38

Re: Slow boot time before & after login (SDDM, KDE)

#14 Post by Protema »

Thanks for the messages, I took the time to give more tries between Debian and Kubuntu.

First I disabled a lot of startup services, both on boot (avahi-daemon, cups-browsed, mpd (!) and NetworkManager-wait-online) and on KDE startup services.

In the end, both of them need 10s for the kernel, and ~15s between plymouth and SDDM (by the way Kubuntu starts plymouth in tty1, which explains why I don't see the login prompt).
Debian needs ~18s to boot the userspace (sometimes longer because of "apt-daily"); but the KDE launch is slow, around 45s, even with Akonadi deactivated.

Kubuntu is the opposite: ~45s for the userspace but the desktop is faster to load.
The top 3 of "systemd-analyze blame" are dev-sdaX.service (X beeing the root partition), systemd-journal-flush and systemd-udevd, they take ~30 seconds each.
On Debian dev-sdaX.service takes 5s and the rest are nearly instantaneous.

I removed the hard disk, it's a 5400rpm; I ran a short and conveyance tests with smartctl, both are ok.
I'm not sure I understand why it's so slow for Kubuntu, I also removed the existing journal logs and set SystemMaxUse of journald.conf to 50M but it still takes time to flush the journal.

L_V
Posts: 1477
Joined: 2007-03-19 09:04
Been thanked: 11 times

Re: Slow boot time before & after login (SDDM, KDE)

#15 Post by L_V »

Why don't you disable apt-daily...... especially with a 5400 rpm disk....
You can simply run 'sudo apt update' only when needed.

"+ 3.777s packagekit.service": do you really need this ????
Do you need plymouth ???

User avatar
Hallvor
Global Moderator
Global Moderator
Posts: 2042
Joined: 2009-04-16 18:35
Location: Kristiansand, Norway
Has thanked: 151 times
Been thanked: 212 times

Re: Slow boot time before & after login (SDDM, KDE)

#16 Post by Hallvor »

Get a cheap SSD. It will be blazing fast compared to that slow HDD.
[HowTo] Install and configure Debian bookworm
Debian 12 | KDE Plasma | ThinkPad T440s | 4 × Intel® Core™ i7-4600U CPU @ 2.10GHz | 12 GiB RAM | Mesa Intel® HD Graphics 4400 | 1 TB SSD

Protema
Posts: 7
Joined: 2018-08-21 17:38

Re: Slow boot time before & after login (SDDM, KDE)

#17 Post by Protema »

The laptop is not mine, I try to configure something as pretty and simple as possible.

So plymouth is nice to have, and Discover (KDE's software center) seems to rely on packagekit.
I'm not sure about apt-daily, if KDE can check itself for updates then I can disabled it (it looks possible, I will try this evening).

Right now I'm trying to understand why dev-sdaX.service, systemd-journal-flush and systemd-udevd services are taking so much time on Kubuntu :?

Post Reply