Bug#925160: systemd: user session slow to start (11 seconds)
Package: im-config
Version: 0.39-1
Followup-For: Bug #925160
I've also encountered slowness here, sometimes to the point of
tripping systemd timeouts. The culprit appears to be repeatedly
searching /usr/lib via find -- on the system where this issue has
bitten me most badly, I have hundreds of thousands of directory
entries there (yes, I'm a packrat):
$ locate /usr/lib/ | wc -l
864543
Here are a few suggestions for ways to do better here:
* Bail right away for non-graphical sessions (possibly extending to
ssh sessions with X forwarding).
* Use shell globbing (ls or even echo) rather than find ... -path ...
unless you specifically need to traverse an unknown number of
directory levels.
** You can probably rely on multiarch specifiers to contain hyphens:
/usr/lib/*-*/gtk-2.0/*/immodules/im-ibus.so
* If you really do need find, consolidate searches more and split them
back out as needed:
IM_CONFIG_ALL_MARKERS="$(find /usr/lib \
-path '/usr/lib*/gtk-?.0/immodules/im-ibus.so' -o \
-path ... -o ...)"
IM_CONFIG_MARKER="$(echo "$IM_CONFIG_ALL_MARKERS" | grep ...)"
* Search ahead of time on the basis of dpkg triggers, an apt hook,
and/or a cron job (bearing in mind that cron job results may
occasionally be inaccurate by the time sessions start).
Could you please consider them, or otherwise address this slowness?
Thanks!
-- System Information:
Debian Release: buster/sid
APT prefers unstable-debug
APT policy: (500, 'unstable-debug'), (500, 'testing-debug'), (500, 'testing'), (500, 'stable'), (300, 'unstable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, x32
Kernel: Linux 4.19.0-2-amd64 (SMP w/4 CPU cores)
Kernel taint flags: TAINT_PROPRIETARY_MODULE, TAINT_WARN, TAINT_OOT_MODULE, TAINT_UNSIGNED_MODULE
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages im-config depends on:
ii gettext-base 0.19.8.1-9
Versions of packages im-config recommends:
ii kde-baseapps-bin 4:16.08.3-3
ii kdialog 4:17.08.3-2
ii whiptail 0.52.20-8
ii x11-common 1:7.7+19
ii zenity 3.30.0-2
im-config suggests no packages.
-- no debconf information
Reply to: