[SOLVED] Do my systemd-analyze results look ok?

Questions about other topics - please check if your question fits better in another category before posting here
Forum rules
Before you post please read how to get help
Post Reply
User avatar
Sir Charles
Level 7
Level 7
Posts: 1827
Joined: Thu Jan 04, 2018 1:00 pm

[SOLVED] Do my systemd-analyze results look ok?

Post by Sir Charles » Wed Mar 07, 2018 12:03 pm

Hi everyone,
I just wondered if the following outputs from systemd-analyze blame and systemd-analyze critical-chain look ok. Is there anything I can do to improve boot-up time?

Code: Select all

systemd-analyze blame
          6.012s NetworkManager-wait-online.service
          2.678s vboxdrv.service
          1.752s dev-sda9.device
          1.447s networking.service
          1.230s accounts-daemon.service
           982ms ModemManager.service
           905ms systemd-logind.service
           824ms ufw.service
           785ms NetworkManager.service
           763ms avahi-daemon.service
           601ms loadcpufreq.service
           583ms cpufreqd.service
           557ms irqbalance.service
           556ms apparmor.service
           550ms lvm2-monitor.service
           547ms ondemand.service
           474ms lightdm.service
           469ms apport.service
           457ms grub-common.service
           445ms console-setup.service
           408ms console-kit-log-system-start.service
           392ms speech-dispatcher.service
           374ms cpufrequtils.service
           348ms iio-sensor-proxy.service
           334ms keyboard-setup.service
           296ms alsa-restore.service
           264ms polkitd.service
           238ms systemd-udev-trigger.service
           223ms upower.service
           223ms binfmt-support.service
           217ms lm-sensors.service
           192ms gpu-manager.service
           191ms rsyslog.service
           182ms systemd-rfkill.service
           163ms pppd-dns.service
           156ms systemd-journald.service
           144ms thermald.service
           141ms systemd-user-sessions.service
           136ms systemd-update-utmp.service
           135ms user@1000.service
           126ms udisks2.service
           113ms glances.service
           107ms ntp.service
            97ms systemd-modules-load.service
            91ms systemd-fsck@dev-disk-by\x2duuid-E840\x2d5E8E.service
            79ms proc-sys-fs-binfmt_misc.mount
            65ms systemd-udevd.service
            62ms systemd-journal-flush.service
            52ms hddtemp.service
            50ms dev-hugepages.mount
            47ms sys-kernel-debug.mount
            45ms dns-clean.service
            44ms kmod-static-nodes.service
            42ms systemd-tmpfiles-clean.service
            41ms vboxautostart-service.service
            40ms systemd-tmpfiles-setup-dev.service
            39ms resolvconf.service
            38ms vboxballoonctrl-service.service
            37ms plymouth-read-write.service
            36ms dev-mqueue.mount
            34ms vboxweb-service.service
            31ms systemd-tmpfiles-setup.service
            29ms rc-local.service
            26ms openvpn.service
            25ms sys-kernel-config.mount
            25ms systemd-sysctl.service
            24ms setvtrgb.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 @9.402s
└─multi-user.target @9.400s
  └─glances.service @9.262s +113ms
    └─network-online.target @9.253s
      └─NetworkManager-wait-online.service @3.239s +6.012s
        └─NetworkManager.service @2.434s +785ms
          └─dbus.service @2.344s
            └─basic.target @2.287s
              └─sockets.target @2.281s
                └─uuidd.socket @2.281s
                  └─sysinit.target @2.270s
                    └─apparmor.service @1.712s +556ms
                      └─local-fs.target @1.683s
                        └─run-cgmanager-fs.mount @2.657s
                          └─local-fs-pre.target @801ms
                            └─lvm2-monitor.service @250ms +550ms
                              └─lvm2-lvmetad.service @292ms
                                └─lvm2-lvmetad.socket @249ms
                                  └─-.slice @177ms
Thanks in advance for your suggestions
Last edited by Sir Charles on Thu Mar 08, 2018 8:12 pm, edited 1 time in total.
I suppose that's one of the ironies of life, doing the wrong thing at the right moment -C.C.

User avatar
greerd
Level 5
Level 5
Posts: 986
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: Do my systemd-analyze results look ok?

Post by greerd » Wed Mar 07, 2018 12:15 pm

You could probably trim some more time off by disabling NetworkManager-wait-online.service. A few people have done this, including myself, without any noticeable effects.
Also if you don't use a modem you can do the same to ModemManager.service although that won't save you as much time. I have a few more than this disabled (like bluetooth) that I'm sure I don't need, but NetworkManager-wait-online.service is the big one.

User avatar
greerd
Level 5
Level 5
Posts: 986
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: Do my systemd-analyze results look ok?

Post by greerd » Wed Mar 07, 2018 12:20 pm

Also systemd-analyze time is another good one.

User avatar
Sir Charles
Level 7
Level 7
Posts: 1827
Joined: Thu Jan 04, 2018 1:00 pm

Re: Do my systemd-analyze results look ok?

Post by Sir Charles » Wed Mar 07, 2018 12:30 pm

greerd wrote:
Wed Mar 07, 2018 12:15 pm
You could probably trim some more time off by disabling NetworkManager-wait-online.service
Thanks greerd for your reply! Yes, that one looks like the bad guy in the play. He has to go away. Is it by running

Code: Select all

systemctl disable NetworkManager-wait-online.service
that I can disable it? Will that make it permanent or do I have to modify some file(s)?

And this one:

Code: Select all

glances.service @9.262s +113ms
I installed it some time ago but does the fact that it shows up here means that it gets started at start-up?
I suppose that's one of the ironies of life, doing the wrong thing at the right moment -C.C.

User avatar
greerd
Level 5
Level 5
Posts: 986
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: Do my systemd-analyze results look ok?

Post by greerd » Wed Mar 07, 2018 12:44 pm

Marziano wrote:
Wed Mar 07, 2018 12:30 pm
greerd wrote:
Wed Mar 07, 2018 12:15 pm
You could probably trim some more time off by disabling NetworkManager-wait-online.service
Thanks greerd for your reply! Yes, that one looks like the bad guy in the play. He has to go away. Is it by running

Code: Select all

systemctl disable NetworkManager-wait-online.service
that I can disable it? Will that make it permanent or do I have to modify some file(s)?
Stick a sudo infront and the service will be disabled permanently, until enabled by you.
And this one:

Code: Select all

glances.service @9.262s +113ms
I installed it some time ago but does the fact that it shows up here means that it gets started at start-up?
You can use systemctl list-unit-files --state enabled --no-page to list all enabled services and sockets, without a page-break (--no-page).
Change the enabled to disabled to see them or remove '--state enabled' to see all possible services.

I would expect that you could also disable any service that was installed by you without any system issues.

User avatar
thx-1138
Level 6
Level 6
Posts: 1290
Joined: Fri Mar 10, 2017 12:15 pm
Location: Athens, Greece

Re: Do my systemd-analyze results look ok?

Post by thx-1138 » Wed Mar 07, 2018 12:47 pm

If you don't use LVM, you can disable all lvm* services.

User avatar
greerd
Level 5
Level 5
Posts: 986
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: Do my systemd-analyze results look ok?

Post by greerd » Wed Mar 07, 2018 12:54 pm

thx-1138 wrote:
Wed Mar 07, 2018 12:47 pm
If you don't use LVM, you can disable all lvm* services.
I've wondered about that one, is it needed for an extended partition or only for LVM?

User avatar
thx-1138
Level 6
Level 6
Posts: 1290
Joined: Fri Mar 10, 2017 12:15 pm
Location: Athens, Greece

Re: Do my systemd-analyze results look ok?

Post by thx-1138 » Wed Mar 07, 2018 12:58 pm

Only for LVM (i don't even have lvm2 installed on my system...)

You also only need vboxdrv.service, the rest vbox* ones aren't really of any importance for common usage.
speech-dispatcher you can also get rid off if you don't need such abilities.
Same thing with dns-clean & pppd-dns if you are on a adsl connection...

User avatar
greerd
Level 5
Level 5
Posts: 986
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: Do my systemd-analyze results look ok?

Post by greerd » Wed Mar 07, 2018 1:02 pm

thx-1138 wrote:
Wed Mar 07, 2018 12:58 pm
Only for LVM (i don't even have lvm2 installed on my system...)

You also only need vboxdrv.service, the rest vbox* ones aren't really of any use for common usage.
speech-dispatcher you can also get rid off if you don't need such abilities.
Same thing with dns-clean & pppd-dns if you are on a adsl connection...
Cool, thanks!

User avatar
Sir Charles
Level 7
Level 7
Posts: 1827
Joined: Thu Jan 04, 2018 1:00 pm

Re: Do my systemd-analyze results look ok?

Post by Sir Charles » Wed Mar 07, 2018 1:22 pm

Thank you both!
Now I've got some disabling to do, I feel already much lighter.
I suppose that's one of the ironies of life, doing the wrong thing at the right moment -C.C.

User avatar
Sir Charles
Level 7
Level 7
Posts: 1827
Joined: Thu Jan 04, 2018 1:00 pm

Re: Do my systemd-analyze results look ok?

Post by Sir Charles » Wed Mar 07, 2018 1:49 pm

thx-1138 wrote:
Wed Mar 07, 2018 12:47 pm
greerd wrote:
Wed Mar 07, 2018 12:15 pm
This is what I've got now:

systemctl list-unit-files --state enabled --no-page:

Code: Select all

UNIT FILE                                  STATE  
acpid.path                                 enabled
cups.path                                  enabled
accounts-daemon.service                    enabled
anacron-resume.service                     enabled
anacron.service                            enabled
autovt@.service                            enabled
avahi-daemon.service                       enabled
binfmt-support.service                     enabled
bluetooth.service                          enabled
brltty.service                             enabled
casper.service                             enabled
cgmanager.service                          enabled
cgproxy.service                            enabled
cron.service                               enabled
cups-browsed.service                       enabled
cups.service                               enabled
dbus-org.bluez.service                     enabled
dbus-org.freedesktop.Avahi.service         enabled
dbus-org.freedesktop.ModemManager1.service enabled
dbus-org.freedesktop.nm-dispatcher.service enabled
dbus-org.freedesktop.thermald.service      enabled
display-manager.service                    enabled
dns-clean.service                          enabled
friendly-recovery.service                  enabled
getty@.service                             enabled
gpu-manager.service                        enabled
hddtemp.service                            enabled
lightdm.service                            enabled
lm-sensors.service                         enabled
mintsystem.service                         enabled
ModemManager.service                       enabled
network-manager.service                    enabled
networking.service                         enabled
NetworkManager-dispatcher.service          enabled
NetworkManager.service                     enabled
ntp.service                                enabled
openvpn.service                            enabled
pppd-dns.service                           enabled
resolvconf.service                         enabled
rsyslog.service                            enabled
syslog.service                             enabled
systemd-timesyncd.service                  enabled
thermald.service                           enabled
ufw.service                                enabled
ureadahead.service                         enabled
vboxdrv.service                            enabled
vnstat.service                             enabled
acpid.socket                               enabled
apport-forward.socket                      enabled
avahi-daemon.socket                        enabled
cups.socket                                enabled
dm-event.socket                            enabled
rpcbind.socket                             enabled
uuidd.socket                               enabled
remote-fs.target                           enabled
apt-daily-upgrade.timer                    enabled
apt-daily.timer                            enabled
systemctl list-unit-files --state disabled --no-page

Code: Select all

acpid.service                         disabled
clamav-freshclam.service              disabled
console-getty.service                 disabled
console-kit-daemon.service            disabled
console-shell.service                 disabled
dbus-org.freedesktop.network1.service disabled
dbus-org.freedesktop.resolve1.service disabled
debug-shell.service                   disabled
dm-event.service                      disabled
ipmi_port.service                     disabled
ipmiutil_asy.service                  disabled
ipmiutil_evt.service                  disabled
ipmiutil_wdt.service                  disabled
kerneloops.service                    disabled
keyboard-setup.service                disabled
lvm2-lvmetad.service                  disabled
lvm2-lvmpolld.service                 disabled
lvm2-monitor.service                  disabled
NetworkManager-wait-online.service    disabled
openvpn@.service                      disabled
rsync.service                         disabled
rtkit-daemon.service                  disabled
serial-getty@.service                 disabled
systemd-bootchart.service             disabled
systemd-networkd-wait-online.service  disabled
systemd-networkd.service              disabled
systemd-resolved.service              disabled
udisks2.service                       disabled
upower.service                        disabled
vboxautostart-service.service         disabled
vboxballoonctrl-service.service       disabled
vboxweb-service.service               disabled
wpa_supplicant.service                disabled
lvm2-lvmetad.socket                   disabled
lvm2-lvmpolld.socket                  disabled
saned.socket                          disabled
systemd-networkd.socket               disabled
ctrl-alt-del.target                   disabled
exit.target                           disabled
halt.target                           disabled
kexec.target                          disabled
poweroff.target                       disabled
reboot.target                         disabled
rescue.target                         disabled
runlevel0.target                      disabled
runlevel1.target                      disabled
runlevel6.target                      disabled
Is there any service that shows up in each of these lists that shouldn't be there? Many of the disabled one were already disabled, by default I imagine.
I suppose that's one of the ironies of life, doing the wrong thing at the right moment -C.C.

User avatar
greerd
Level 5
Level 5
Posts: 986
Joined: Sat Jul 31, 2010 10:58 am
Location: Nova Scotia, Canada

Re: Do my systemd-analyze results look ok?

Post by greerd » Wed Mar 07, 2018 2:14 pm

I'm sure there are more you can disable, for example brltty.service is not needed unless you need braille display. The best thing is to google them.
Note that most of these only save a couple of tens of millisec's so not much saved.

By the way, what does your systemd-analyze critical-chain look like now that NetworkManager-wait-online.service is disabled?

User avatar
Sir Charles
Level 7
Level 7
Posts: 1827
Joined: Thu Jan 04, 2018 1:00 pm

Re: Do my systemd-analyze results look ok?

Post by Sir Charles » Wed Mar 07, 2018 2:27 pm

greerd wrote:
Wed Mar 07, 2018 2:14 pm
By the way, what does your systemd-analyze critical-chain look like now that NetworkManager-wait-online.service is disabled?
It looks much better!

systemd-analyze critical-chain

Code: Select all

└─multi-user.target @4.610s
  └─vboxdrv.service @2.209s +2.399s
    └─basic.target @2.129s
      └─paths.target @2.129s
        └─acpid.path @2.128s
          └─sysinit.target @2.112s
            └─apparmor.service @1.429s +590ms
              └─local-fs.target @1.425s
                └─run-cgmanager-fs.mount @2.477s
                  └─local-fs-pre.target @518ms
                    └─systemd-remount-fs.service @480ms +17ms
                      └─systemd-journald.socket @203ms
                        └─-.mount @178ms
                          └─system.slice @202ms
                            └─-.slice @178ms
And for systemd-analyze blame

Code: Select all

  
          2.399s vboxdrv.service
          1.177s dev-sda9.device
          1.087s accounts-daemon.service
           901ms ModemManager.service
           880ms networking.service
           829ms ufw.service
           674ms thermald.service
           647ms NetworkManager.service
           619ms loadcpufreq.service
           590ms apparmor.service
           566ms avahi-daemon.service
           510ms systemd-logind.service
           451ms console-setup.service
           444ms cpufreqd.service
           402ms speech-dispatcher.service
           384ms apport.service
           375ms console-kit-log-system-start.service
           365ms irqbalance.service
           361ms lightdm.service
           358ms systemd-user-sessions.service
           352ms ntp.service
           342ms grub-common.service
           341ms ondemand.service
           299ms cpufrequtils.service
           266ms rsyslog.service
           265ms gpu-manager.service
           249ms keyboard-setup.service
           233ms systemd-udev-trigger.service
           221ms lm-sensors.service
           215ms glances.service
           176ms hddtemp.service
           169ms pppd-dns.service
           157ms binfmt-support.service
           149ms systemd-journald.service
           143ms upower.service
           130ms polkitd.service
           124ms openvpn.service
           118ms systemd-update-utmp.service
           109ms systemd-rfkill.service
           107ms iio-sensor-proxy.service
            89ms systemd-modules-load.service
            88ms kmod-static-nodes.service
            81ms user@1000.service
            74ms resolvconf.service
            71ms systemd-fsck@dev-disk-by\x2duuid-E840\x2d5E8E.service
            69ms dev-mqueue.mount
            68ms rc-local.service
            54ms dev-disk-by\x2duuid-c78a6d78\x2d1130\x2d44da\x2d8dc5\x2d1e5a388cdd71.swap
            53ms dev-hugepages.mount
            52ms plymouth-quit-wait.service
            49ms plymouth-start.service
            48ms dns-clean.service
            46ms plymouth-read-write.service
            44ms systemd-udevd.service
            43ms systemd-tmpfiles-setup-dev.service
            40ms systemd-tmpfiles-setup.service
            36ms proc-sys-fs-binfmt_misc.mount
            35ms systemd-sysctl.service
            34ms sys-kernel-debug.mount
            33ms systemd-journal-flush.service
            30ms sys-fs-fuse-connections.mount
            21ms boot-efi.mount
            17ms systemd-remount-fs.service
            17ms sys-kernel-config.mount
            14ms wpa_supplicant.service
            13ms systemd-update-utmp-runlevel.service
            11ms ureadahead-stop.service
            11ms rtkit-daemon.service
            11ms setvtrgb.service
             9ms systemd-random-seed.service
             7ms bluetooth.service
             3ms systemd-backlight@backlight:intel_backlight.service

systemd-analyze

Code: Select all

Startup finished in 1.529s (firmware) + 5.087s (loader) + 6.758s (kernel) + 4.631s (userspace) = 18.007s
Definitely an improvement by around 7 seconds.
I suppose that's one of the ironies of life, doing the wrong thing at the right moment -C.C.

User avatar
thx-1138
Level 6
Level 6
Posts: 1290
Joined: Fri Mar 10, 2017 12:15 pm
Location: Athens, Greece

Re: Do my systemd-analyze results look ok?

Post by thx-1138 » Wed Mar 07, 2018 3:17 pm

brltty is a very good suggestion. As already mentioned above, speech-dispatcher if you don't use text-to-speech apps...and also, if you're always connecting via adsl or newer, dns-clean, pppd-dns and ModemManager as well.
To tweak even more than that, you could always google&read what each service does, why & how: however, by doing so, i can guarantee you that you'd probably gain more in the long-term...than having immediate results of 'shaving off' more time. Why? Because 4.631s (userspace) =>
if you spend your time tweaking this or that or the other one, you could probably save off 1 maximum 1.5 secs out of it.
Which in return raises the question: is there an actual difference that you could really feel between say 16.7secs and...18.007s?
If you had a 5400rpm hdd that took 51secs to boot, then dropping it down to 35secs makes sense...but 1 to 1.5 secs?
Try also checking if Fast Boot is enabled in your UEFI. It should be set to off when installing a distro, but it might help resulting in faster boot times afterwards (especially when it's not a cold boot).
Marziano wrote:
Wed Mar 07, 2018 1:49 pm
Is there any service that shows up in each of these lists that shouldn't be there?
Define "shouldn't". Everything is there for a reason - it's not built incorrectly in the first place, it's not...Windows Millenium ;-)
Question is, if you also have a reason for this or that to be running: and that is something that only you can answer it.

User avatar
Sir Charles
Level 7
Level 7
Posts: 1827
Joined: Thu Jan 04, 2018 1:00 pm

Re: Do my systemd-analyze results look ok?

Post by Sir Charles » Wed Mar 07, 2018 5:25 pm

thx-1138 wrote:
Wed Mar 07, 2018 3:17 pm
What you say makes perfect sense. I will be taking my time to explore these services to gain a better understanding of them.
thx-1138 wrote:
Wed Mar 07, 2018 3:17 pm
Marziano wrote:
Wed Mar 07, 2018 1:49 pm
Is there any service that shows up in each of these lists that shouldn't be there?
Define "shouldn't". Everything is there for a reason - it's not built incorrectly in the first place, it's not...Windows Millenium ;-)
Question is, if you also have a reason for this or that to be running: and that is something that only you can answer it.
I admit that it is a bit clumsily expressed. What I wanted to say was that if there is one or other services which should be on the other list and vice versa not that they shouldn't t be there at all.
I suppose that's one of the ironies of life, doing the wrong thing at the right moment -C.C.

User avatar
Sir Charles
Level 7
Level 7
Posts: 1827
Joined: Thu Jan 04, 2018 1:00 pm

Re: Do my systemd-analyze results look ok?

Post by Sir Charles » Wed Mar 07, 2018 5:32 pm

thx-1138 wrote:
Wed Mar 07, 2018 12:47 pm
greerd wrote:
Wed Mar 07, 2018 12:15 pm
Thank you both for sharing your knowledge and insights.
I greatly appreciate it.

Cheers
Marziano
I suppose that's one of the ironies of life, doing the wrong thing at the right moment -C.C.

Post Reply

Return to “Other topics”