You are not logged in.

#1 2019-08-22 08:09:54

OrigBitmancer
Member
Registered: 2019-01-22
Posts: 144

[Solved] ldconfig.service causes slow startup

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

graphical.target @1min 31.622s
└─lxdm.service @1min 31.620s
  └─systemd-user-sessions.service @1min 31.199s +415ms
    └─network.target @1min 31.193s
      └─dhcpcd.service @1min 22.333s +8.856s
        └─basic.target @1min 21.698s
          └─sockets.target @1min 21.698s
            └─org.cups.cupsd.socket @1min 21.697s
              └─sysinit.target @1min 20.829s
                └─systemd-update-done.service @1min 20.786s +42ms
                  └─ldconfig.service @47.657s +33.127s     <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ouch!
                    └─local-fs.target @47.654s
                      └─media-old_other.mount @47.199s +454ms
                        └─systemd-fsck@dev-disk-by\x2dlabel-old_other.service @43.446s +3.750s
                          └─local-fs-pre.target @43.402s
                            └─systemd-tmpfiles-setup-dev.service @23.438s +5.217s
                              └─systemd-sysusers.service @17.334s +6.100s
                                └─systemd-remount-fs.service @16.933s +212ms
                                  └─systemd-fsck-root.service @12.973s +3.958s

How can I make the ldconfig.service run faster or go to the background? (nearly 6000 real load modules to process)

App startup in general is slow. How do I instrument this for debugging? (No apparent dmesg output)

Last edited by OrigBitmancer (2019-08-22 21:28:25)

Offline

#2 2019-08-22 11:18:07

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,390
Website

Re: [Solved] ldconfig.service causes slow startup

My guess is that you can completely disable it.   pacman runs ldconfig after updating anyway, so there should be no need for that service as long as you install software using pacman.

Offline

#3 2019-08-22 14:10:51

OrigBitmancer
Member
Registered: 2019-01-22
Posts: 144

Re: [Solved] ldconfig.service causes slow startup

I would never have checked that. Thanks!

Now, what debug info would help me speed up the delay in process startup?

Last edited by OrigBitmancer (2019-08-22 14:13:17)

Offline

#4 2019-08-22 14:21:35

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,723

Re: [Solved] ldconfig.service causes slow startup

strace an affected program and check where it hangs should be a good first step, post the output if you need help interpreting it.

Offline

#5 2019-08-22 21:15:41

OrigBitmancer
Member
Registered: 2019-01-22
Posts: 144

Re: [Solved] ldconfig.service causes slow startup

strace! D’oh! Thanks! It has been too long since I used it. I *think* I can still read the output. Very grateful, V1del!

Offline

#6 2019-08-22 21:21:53

OrigBitmancer
Member
Registered: 2019-01-22
Posts: 144

Re: [Solved] ldconfig.service causes slow startup

OrigBitmancer wrote:

How can I make the ldconfig.service run faster or go to the background? (nearly 6000 real load modules to process)

App startup in general is slow. How do I instrument this for debugging? (No apparent dmesg output)

Answers:
1) Disable ldconfig.service.

2) use strace(1) on the affected program.

Offline

#7 2019-08-23 07:12:04

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,723

Re: [Solved] ldconfig.service causes slow startup

Did you figure the cause and a fix?

Offline

#8 2019-08-27 01:25:35

OrigBitmancer
Member
Registered: 2019-01-22
Posts: 144

Re: [Solved] ldconfig.service causes slow startup

I can verify that the following code deleted the ldconfig.service calls during startup:

systemctl disable ldconfig.service
systemctl stop ldconfig.service

And now I start with a lot less delay.


I fear I should have started another thread with the strace(1) stuff. The notably slower apps (increased 3 - 4 times slower than they were) I notice most are Thunderbird, Mozilla, and Chrome.
All apps seem affected. There might be some ld.so interaction here, since this is a dynamic loader environment.

If there is no masking (local before system, for example) of dynamic libraries, is it kosher to play with the contents (and division) of  /etc/ld.so.conf.d/*.conf ?
For instance,

cat  /etc/ld.so.conf.d/*.conf 

yields

/usr/lib/
/usr/lib/ffmpeg3.4/
/usr/lib/R/lib
/usr/lib/libfakeroot
/usr/lib/gigedit
/usr/lib32/libfakeroot
/usr/lib32
/usr/lib/libgig
/usr/lib/linuxsampler
/usr/lib/octave/5.1.0
/usr/lib/opencollada
/usr/lib/openmpi
/usr/lib/perf

There are several thousand results for

find /usr/lib -name \*.so -ls |grep -v lrwx|wc -l

(almost 12000)
so the cleanup (?) might take a while.

Last edited by OrigBitmancer (2019-08-27 03:23:40)

Offline

#9 2019-08-27 08:03:01

Allan
Pacman
From: Brisbane, AU
Registered: 2007-06-09
Posts: 11,390
Website

Re: [Solved] ldconfig.service causes slow startup

You have a choice here - either ldconfig looks at all your libraries on startup, or libraries are first read when a program needs them.  You used to have ldconfig taking ages during startup but then all future access to system libraries was cached and fast.  Not anymore, which is why you notice large programs taking a while to load.

Don't adjust things in /etc/ld.so.conf.d/.   You will only end up with issues...

Offline

#10 2019-08-27 09:31:33

xerxes_
Member
Registered: 2018-04-29
Posts: 675

Re: [Solved] ldconfig.service causes slow startup

I noticed that ldconfig.service is run on startup only if something was updated. Am I right?

Offline

#11 2019-08-27 10:22:17

loqs
Member
Registered: 2014-03-06
Posts: 17,369

Re: [Solved] ldconfig.service causes slow startup

xerxes_ from the unit file

ConditionNeedsUpdate=|/etc
ConditionFileNotEmpty=|!/etc/ld.so.cache

Offline

#12 2019-08-29 19:19:23

OrigBitmancer
Member
Registered: 2019-01-22
Posts: 144

Re: [Solved] ldconfig.service causes slow startup

Thanks to Allan, xerxes_, V1del, and loqs for wisdom imparted.
I will now just suck it up and go refresh my soda when booting.
I update every day, so it is no wonder that this changes every time I reboot.

Offline

Board footer

Powered by FluxBB