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

 

 

 

Debian 9 slow boot

If none of the specific sub-forums seem right for your thread, ask here.
Message
Author
uthappam
Posts: 242
Joined: 2010-01-01 17:14
Location: Delhi, India

Debian 9 slow boot

#1 Post by uthappam »

Debian 9 XFCE 64-bit is my main operating system and Manjaro is on another partition on the same hard drive. The Manjaro GRUB controls booting. For some while now, Debian has been taking longer to boot than it did earlier. Could this be related to the settings in etc/systemd/system.conf?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Debian 9 slow boot

#2 Post by Head_on_a_Stick »

At a guess I would blame the systemd journal, do you have it set to persistent logging?

Try `systemd-analyze` to breakdown the boot process.
deadbang

uthappam
Posts: 242
Joined: 2010-01-01 17:14
Location: Delhi, India

Re: Debian 9 slow boot

#3 Post by uthappam »

How is journal logging for systemd controlled? I found nothing about it in /etc/systemd/journald.conf or in /etc/systemd/system.conf.

In system.conf there is a line "DefaultTimeoutStartSec=90sec". Does it mean a delay of 90 seconds?

Report of "systemd-analyze":
Startup finished in 2.526s (kernel) + 36.456s (userspace) = 38.982s

... and that of "systemd-analyze blame" (the two longest times):
14.926s exim4.service
9.897s NetworkManager-wait-online.service

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Debian 9 slow boot

#4 Post by Head_on_a_Stick »

uthappam wrote:How is journal logging for systemd controlled?
See journald.conf(5).

If you haven't changed anything then the logs should be non-persistent.

You can use the logs to analyze the problem, for example:

Code: Select all

journalctl -u exim4
deadbang

uthappam
Posts: 242
Joined: 2010-01-01 17:14
Location: Delhi, India

Re: Debian 9 slow boot

#5 Post by uthappam »

Thank you. I looked at the link you gave. Logging is set to "auto" by default, it appears, and I have changed nothing.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Debian 9 slow boot

#6 Post by debiman »

boot into the "slow" system and execute

Code: Select all

systemd-analyze blame
and show us the output.

uthappam
Posts: 242
Joined: 2010-01-01 17:14
Location: Delhi, India

Re: Debian 9 slow boot

#7 Post by uthappam »

I did it earlier, debiman, but I posted only the top two results. Here is everything that took 1 second or longer.

Code: Select all

9.677s NetworkManager-wait-online.service
          6.626s apt-daily.service
          4.238s ModemManager.service
          3.873s networking.service
          3.851s exim4.service
          3.595s dev-sda1.device
          3.013s systemd-logind.service
          2.987s clamav-daemon.service
          2.731s pppd-dns.service
          2.490s rsyslog.service
          2.118s avahi-daemon.service
          1.565s NetworkManager.service
          1.511s lightdm.service
          1.044s upower.service
          1.011s keyboard-setup.service
 

bedtime
Posts: 146
Joined: 2012-12-16 19:34
Has thanked: 1 time
Been thanked: 6 times

Re: Debian 9 slow boot

#8 Post by bedtime »

Could you list your computer's specs? I ask as it looks like it might just be an issue of low 'horsepower' on your machine; everything seems in line with what I see so far, though I'm no expert. I remember my boot time to be about 30 seconds or so. On my new computer it's about >3 seconds. So, as you can see, it can make a huge difference.

That aside, there are perhaps a few small things that might gain you a second here or there at the cost of convenience.

uthappam
Posts: 242
Joined: 2010-01-01 17:14
Location: Delhi, India

Re: Debian 9 slow boot

#9 Post by uthappam »

This was in my first post: "For some while now, Debian has been taking longer to boot than it did earlier." My computer took less time to boot in the past. An unchanged machine has slowed down. I have not removed after-burner or turbo-charger.

User avatar
sunrat
Administrator
Administrator
Posts: 6382
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 115 times
Been thanked: 456 times

Re: Debian 9 slow boot

#10 Post by sunrat »

What's the output from:

Code: Select all

journalctl -b -p3
Also your "blame" result doesn't look too bad, only slightly slower than my Core2Duo. What's the output of

Code: Select all

systemd-analyze
Mine is

Code: Select all

$ systemd-analyze
Startup finished in 5.709s (kernel) + 13.236s (userspace) = 18.945s
graphical.target reached after 9.004s in userspace
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

uthappam
Posts: 242
Joined: 2010-01-01 17:14
Location: Delhi, India

Re: Debian 9 slow boot

#11 Post by uthappam »

Here is the result of "journalctl -b -p3"

Code: Select all

-- Logs begin at Sat 2018-08-11 06:46:07 IST, end at Sat 2018-08-11 07:01:47 IST
Aug 11 06:46:24 pappu avahi-daemon[437]: chroot.c: open() failed: No such file o
~
... and "systemd-analyze" gave

Code: Select all

Startup finished in 3.646s (kernel) + 46.182s (userspace) = 49.829s

uthappam
Posts: 242
Joined: 2010-01-01 17:14
Location: Delhi, India

Re: Debian 9 slow boot

#12 Post by uthappam »

At
https://unix.stackexchange.com/question ... talling-it

I found

Code: Select all

sudo systemctl disable --now avahi-daemon.socket && sudo systemctl disable --now avahi-daemon.service
whose effect was

Code: Select all

systemd-analyze
Startup finished in 2.488s (kernel) + 24.000s (userspace) = 26.488s

User avatar
sunrat
Administrator
Administrator
Posts: 6382
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 115 times
Been thanked: 456 times

Re: Debian 9 slow boot

#13 Post by sunrat »

Nice! Gained 23 seconds. Does it seem to be booting in expected time now?
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

uthappam
Posts: 242
Joined: 2010-01-01 17:14
Location: Delhi, India

Re: Debian 9 slow boot

#14 Post by uthappam »

I did not time it, now or earlier: but it does seem to have speeded up. However, Manjaro on the same computer is faster. I hope I have done nothing dangerous by tinkering with Avahi. It's been a few hours and the computer has not exploded.

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Debian 9 slow boot

#15 Post by Head_on_a_Stick »

Let's see what services are enabled, I trim mine considerably post-installation to get a sub-5-second boot time on a 2010 ThinkPad X201 :)

Code: Select all

systemctl list-unit-files --state=enabled --no-p
Enjoy the green prompt afterwards, I reported the bug and it is fixed upstream but not in the OS that I'm actually using, unfortunately.

Looking at your posted output, I would rip out exim4 (unless you actually use it) and also change from NetworkManager to either systemd-networkd or /etc/network/interfaces & ifupdown, both are signifanctly quicker than NM (and also lighter on resources & less buggy).
deadbang

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Debian 9 slow boot

#16 Post by debiman »

uthappam wrote:whose effect was

Code: Select all

systemd-analyze
Startup finished in 2.488s (kernel) + 24.000s (userspace) = 26.488s
would be nice to see the 'blame' output again (1).

previously, it was clearly apt-daily that took the longest.
tried disabling that to see if it speeds things up?
then another 'systemd-analyze blame' (2)?

uthappam
Posts: 242
Joined: 2010-01-01 17:14
Location: Delhi, India

Re: Debian 9 slow boot

#17 Post by uthappam »

Thank you. Here is what systemctl list-unit-files --state=enabled --no-p gave:

Code: Select all

UNIT FILE                                  STATE  
cups.path                                  enabled
anacron.service                            enabled
autovt@.service                            enabled
binfmt-support.service                     enabled
clamav-daemon.service                      enabled
clamav-freshclam.service                   enabled
console-setup.service                      enabled
cron.service                               enabled
cups-browsed.service                       enabled
cups.service                               enabled
dbus-org.freedesktop.ModemManager1.service enabled
dbus-org.freedesktop.nm-dispatcher.service enabled
display-manager.service                    enabled
getty@.service                             enabled
irqbalance.service                         enabled
keyboard-setup.service                     enabled
lightdm.service                            enabled
lm-sensors.service                         enabled
ModemManager.service                       enabled
network-manager.service                    enabled
networking.service                         enabled
NetworkManager-dispatcher.service          enabled
NetworkManager-wait-online.service         enabled
NetworkManager.service                     enabled
pppd-dns.service                           enabled
rsync.service                              enabled
rsyslog.service                            enabled
rtkit-daemon.service                       enabled
syslog.service                             enabled
systemd-timesyncd.service                  enabled
cups.socket                                enabled
uuidd.socket                               enabled
remote-fs.target                           enabled
anacron.timer                              enabled
apt-daily-upgrade.timer                    enabled
apt-daily.timer                            enabled

36 unit files listed.
I shall need to look through the list of services and figure out which I can live without. The first step is to find out what exim4 does. Changing from Network Manager is also something I know nothing about. If I cannot find the procedure by searching I shall reappear here. Thank you again.

uthappam
Posts: 242
Joined: 2010-01-01 17:14
Location: Delhi, India

Re: Debian 9 slow boot

#18 Post by uthappam »

@debiman, looks like I missed your last post as I was composing my own. I shall do as you ask in an hour or so. Thank you for your interest.
[Later addition] Here we are. One second and longer times listed.

Code: Select all

1min 3.330s exim4.service
          9.978s NetworkManager-wait-online.service
          3.689s ModemManager.service
          3.527s dev-sda1.device
          3.037s networking.service
          2.491s speech-dispatcher.service
          2.409s NetworkManager.service
          2.165s lm-sensors.service
          2.133s rsyslog.service
          1.978s systemd-logind.service
          1.942s rtkit-daemon.service
          1.915s avahi-daemon.service
          1.820s pppd-dns.service
          1.817s alsa-restore.service
          1.609s colord.service
          1.199s keyboard-setup.service

uthappam
Posts: 242
Joined: 2010-01-01 17:14
Location: Delhi, India

Re: Debian 9 slow boot

#19 Post by uthappam »

After everything connected to exim4 was removed, the times reported by systemd-analyze are little different from what they were earlier.

Changing to systemd-networkd involves manual configuration of the latter, and I shall have to search for the necessary information.

User avatar
debiman
Posts: 3063
Joined: 2013-03-12 07:18

Re: Debian 9 slow boot

#20 Post by debiman »

https://www.startpage.com/do/dsearch?qu ... +slow+boot
you are not the only one.
i looked at the fedoraforums thread; essentially, it seems you should just disable network manager completely.
or run through all the services that depend on it and make them wait without blocking the system.
or find out why the connection takes so long (wifi? dns?).

Post Reply