openSUSE 13.2 slow boot speed.

Greetings!

I was hoping if someone could help me reduce my boot time, which is taking quite a lot of time. Perhaps someone could suggest a few services that are not needed for an average laptop user.

Here are some outputs that could prove useful.

Thanks in advance!

systemd-analyze
Startup finished in 3.153s (firmware) + 3.329s (loader) + 3.991s (kernel) + 18.329s (initrd) + 34.277s (userspace) = 1min 3.081s
systemd-analyze blame
         20.767s display-manager.service
         19.460s SuSEfirewall2_init.service
         15.504s systemd-cryptsetup@cr_ata\x2dWDC_WD5000LPVX\x2d80V0TT0_WD\x2dWX61A4480800\x2dpart3.service
          4.125s systemd-udev-settle.service
          3.089s lvm2-activation-early.service
          2.017s fglrxrebuild.service
          1.836s systemd-fsck-root.service
          1.560s SuSEfirewall2.service
          1.489s apparmor.service
          1.190s systemd-fsck@dev-disk-by\x2duuid-356e87eb\x2d639b\x2d408d\x2dbd45\x2dd76e4031e0d3.service
          1.169s systemd-tmpfiles-setup-dev.service
          1.155s lvm2-activation.service
          1.120s dev-mqueue.mount
          1.115s sys-kernel-debug.mount
          1.102s dev-hugepages.mount
           902ms systemd-journald.service
           847ms systemd-fsck@dev-system-home.service
           767ms udisks2.service
           700ms postfix.service
           629ms boot.mount
           603ms systemd-udev-trigger.service
           593ms bluetooth.service
           578ms systemd-backlight@backlight:acpi_video0.service
           568ms boot-efi.mount
           550ms systemd-rfkill@rfkill2.service
           550ms systemd-rfkill@rfkill1.service
           548ms systemd-rfkill@rfkill0.service
           406ms systemd-udev-root-symlink.service
           382ms dm-event.service
           330ms cycle.service
           300ms home.mount
           267ms ModemManager.service
           265ms systemd-sysctl.service
           250ms NetworkManager.service
           243ms user@1000.service
           211ms ntpd.service
           150ms systemd-readahead-replay.service
           142ms systemd-readahead-collect.service
           105ms dev-system-swap.swap
           105ms kmod-static-nodes.service
           101ms atieventsd.service
           101ms systemd-tmpfiles-setup.service
           101ms systemd-modules-load.service
           100ms systemd-user-sessions.service
            88ms nscd.service
            86ms rc-local.service
            84ms avahi-daemon.service
            79ms plymouth-read-write.service
            77ms user@484.service
            75ms polkit.service
            72ms wpa_supplicant.service
            63ms systemd-tmpfiles-clean.service
            45ms rtkit-daemon.service
            28ms plymouth-start.service
            24ms lvm2-lvmetad.service
            24ms systemd-remount-fs.service
            22ms systemd-vconsole-setup.service
            15ms iscsi.service
            15ms systemd-logind.service
            13ms upower.service
            11ms systemd-journal-flush.service
             7ms systemd-readahead-done.service
             6ms sys-fs-fuse-connections.mount
             6ms systemd-update-utmp.service
             6ms systemd-update-utmp-runlevel.service
             5ms auditd.service
             3ms systemd-udevd.service
             3ms systemd-random-seed.service

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 @34.269s
└─multi-user.target @34.269s
  └─SuSEfirewall2.service @32.708s +1.560s
    └─network.target @32.687s
      └─NetworkManager.service @32.435s +250ms
        └─SuSEfirewall2_init.service @12.970s +19.460s
          └─basic.target @12.867s
            └─timers.target @12.866s
              └─systemd-tmpfiles-clean.timer @12.866s
                └─sysinit.target @12.866s
                  └─apparmor.service @11.376s +1.489s
                    └─systemd-tmpfiles-setup.service @11.268s +101ms
                      └─local-fs.target @11.241s
                        └─home.mount @10.940s +300ms
                          └─systemd-fsck@dev-system-home.service @10.030s +847ms
                            └─dev-system-home.device @10.022s


I’m gong to argue that you don’t really need to go too far down the list of times (and then tell you that I was lying…sorry). If you want to save several seconds there isn’t much point in looking at stuff that only takes 0.1 second, so from the systemd-analyze blame, only the first few are worth looking at. the firewall iinit seems a bit long…do you have anything odd going on with your firewall rules?

Perhaps more important is that
15.504s systemd-cryptsetup@cr_ata\x2dWDC_WD5000LPVX\x2d80V0TT0_WD\x2dWX61A4480800\x2dpart3.service

That seems to imply that you are using an encrypted volume which takes some setting up, and probably is slowing down every disk access. Is that really worth it to you? (I don’t have a way of speeding this up, and this is the area in which I was lying - if it slows down every disk access, it can be worth worrying about, even if the setup for encryption itself doesn’t show up as bad.)

On 2015-07-22 18:26, pneuma00 wrote:

> I was hoping if someone could help me reduce my boot time, which is
> taking quite a lot of time.

A minute is not a lot. Five would be :slight_smile:


>     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.

>   └─SuSEfirewall2.service @32.708s +1.560s

>   └─SuSEfirewall2_init.service @12.970s +19.460s

>   └─apparmor.service @11.376s +1.489s

>   └─systemd-fsck@dev-system-home.service @10.030s +847ms

Those are your culprits. The firewall takes more than 20 seconds to
start, probably because the network takes time to start.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

Thanks for the quick reply.

Indeed I’m using full disk encryption (lvm + luks, if I’m not mistaken); it’s worth using it, mainly for added security.

if it slows down every disk access, it can be worth worrying about, even if the setup for encryption itself doesn’t show up as bad.

How could i check if something is set up incorrectly?

Thanks for the quick reply.

You’re right, a minute is not a lot, at all. I was just hoping I could disable some unneede services (without rendering my system unusable). Maybe you could point out a few that could be disabled?

On 2015-07-23 07:26, pneuma00 wrote:

> You’re right, a minute is not a lot, at all. I was just hoping I could
> disable some unneede services (without rendering my system unusable).
> Maybe you could point out a few that could be disabled?

None.

Your problem is not about disabling services, but making ONE particular
service faster.

It is the firewall start which is slow. Only that one.

Guess: are you using automatic network setup? Try manual mode (ie,
specify IP, GW, DNS).

Are you using WiFi? Then not much you can do.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

On 2015-07-23 07:26, pneuma00 wrote:

>> if it slows down every disk access, it can be worth worrying about, even
>> if the setup for encryption itself doesn’t show up as bad.
>
> How could i check if something is set up incorrectly?

No.

Writing to an encrypted device is simply about half speed, and there is
nothing you can do about it. Well, yes: buy a faster motherboard, faster
CPU, more RAM, and faster.

Writing zeroes to an encrypted loop filesystem on my laptop:


cer@minas-tirith:~> dd if=/dev/zero of=deleteme count=10000
10000+0 records in
10000+0 records out
5120000 bytes (5.1 MB) copied, 0.0630134 s, 81.3 MB/s
cer@minas-tirith:~> dd if=/dev/zero of=deleteme count=10000
10000+0 records in
10000+0 records out
5120000 bytes (5.1 MB) copied, 0.0647901 s, 79.0 MB/s
cer@minas-tirith:~> dd if=/dev/zero of=deleteme count=10000
10000+0 records in
10000+0 records out
5120000 bytes (5.1 MB) copied, 0.0648623 s, 78.9 MB/s
cer@minas-tirith:~>

Same to non encrypted space:


minas-tirith:~ # dd if=/dev/zero of=deleteme count=10000
10000+0 records in
10000+0 records out
5120000 bytes (5.1 MB) copied, 0.0351234 s, 146 MB/s
minas-tirith:~ # dd if=/dev/zero of=deleteme count=10000
10000+0 records in
10000+0 records out
5120000 bytes (5.1 MB) copied, 0.0414303 s, 124 MB/s
minas-tirith:~ # dd if=/dev/zero of=deleteme count=10000
10000+0 records in
10000+0 records out
5120000 bytes (5.1 MB) copied, 0.036626 s, 140 MB/s
minas-tirith:~ # dd if=/dev/zero of=deleteme count=10000
10000+0 records in
10000+0 records out
5120000 bytes (5.1 MB) copied, 0.0357585 s, 143 MB/s
minas-tirith:~ #


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

I understand. Most of the time, the laptop is connected directly to the wifi router, via cable. If I set up manual mode, would that affect the functionality of the other devices connected to the same router?

No.

Writing to an encrypted device is simply about half speed, and there is
nothing you can do about it. Well, yes: buy a faster motherboard, faster
CPU, more RAM, and faster.

Thanks, I didn’t know that, actually.

On 2015-07-26 17:36, pneuma00 wrote:

>> Guess: are you using automatic network setup? Try manual mode (ie,
>> specify IP, GW, DNS).
>>
>> Are you using WiFi? Then not much you can do.

> I understand. Most of the time, the laptop is connected directly to the
> wifi router, via cable. If I set up manual mode, would that affect the
> functionality of the other devices connected to the same router?

I don’t see why.

You just write down an IP number in the network configuration, and make
sure it is outside of the range that the router automatically assigns.

I mean, the router may handle out, automatically, addresses in the
192.168.1.1 to 192.168.1.100 range, for instance. So you would give your
computer the 192.168.1.101 address.

This way, your computer does not wast time telling the router that it
wants an IP. I have no idea why, but some times this is quite slow.

>> No.
>>
>> Writing to an encrypted device is simply about half speed, and there is
>> nothing you can do about it. Well, yes: buy a faster motherboard, faster
>> CPU, more RAM, and faster.
>
> Thanks, I didn’t know that, actually.

Just measure the speed, it is simple :slight_smile:


dd if=/dev/zero of=deleteme count=100000

Do this inside the encrypted space, and in the non-encrypted space of
the same disk.

Encrypted:


cer@Telcontar:~/Cripta> dd if=/dev/zero of=deleteme count=100000
100000+0 records in
100000+0 records out
51200000 bytes (51 MB) copied, 0,138355 s, 370 MB/s
cer@Telcontar:~/Cripta> dd if=/dev/zero of=deleteme count=100000
oflag=direct
100000+0 records in
100000+0 records out
51200000 bytes (51 MB) copied, 28,2745 s, 1,8 MB/s
cer@Telcontar:~/Cripta>

Non encrypted:


cer@Telcontar:~> dd if=/dev/zero of=deleteme count=100000
100000+0 records in
100000+0 records out
51200000 bytes (51 MB) copied, 0,321419 s, 159 MB/s
cer@Telcontar:~> dd if=/dev/zero of=deleteme count=100000 oflag=direct
100000+0 records in
100000+0 records out
51200000 bytes (51 MB) copied, 27,0852 s, 1,9 MB/s
cer@Telcontar:~>

Or perhaps, more true:


cer@Telcontar:~/Cripta> dd if=/dev/zero of=deleteme count=100000 conv=fsync
100000+0 records in
100000+0 records out
51200000 bytes (51 MB) copied, 0,644599 s, 79,4 MB/s
cer@Telcontar:~/Cripta>

cer@Telcontar:~> dd if=/dev/zero of=deleteme count=100000 conv=fsync
100000+0 records in
100000+0 records out
51200000 bytes (51 MB) copied, 0,732437 s, 69,9 MB/s

It depends a lot on CPU; thus in my laptop it is about half as slow,
compared to my desktop.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

I’ve set up static ip for my laptop, and the boot speed increase is quite significant.

systemd-analyze
Startup finished in 3.283s (firmware) + 1.926s (loader) + 3.991s (kernel) + 10.990s (initrd) + 25.573s (userspace) = 45.765s

Thank you vey much for your help. Regarding the disk encryption + slower write/read speed, I think I’ll take that trade.

Again, thank you!

On 2015-07-28 02:26, pneuma00 wrote:
> I’ve set up static ip for my laptop, and the boot speed increase is
> quite significant.

Have a look at the “critical path” output, it is the one most indicative
of problems.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)