Bug#946961: systemd: systemctl list-unit-files takes more than a second

Dejan Muhamedagic dejanmm at fastmail.fm
Wed Dec 18 14:28:38 GMT 2019


Package: systemd
Version: 241-7~deb10u2
Severity: important

Dear Maintainer,

Listing systemd units takes more than a second on a rather fast
system:

# time systemctl list-unit-files | wc
351     703   19219

real	0m1.107s
user	0m0.000s
sys	0m0.013s

Adding a filter makes it run twice as long:

# time systemctl --state=enabled list-unit-files | wc
     63     127    2890

real	0m2.153s
user	0m0.010s
sys	0m0.002s

During this time, the PID 1 (systemd) makes an inordinate number
of file access system calls (counts, from the strace output):

      1 accept4
      1 getsockname
      1 sendmsg
      2 setsockopt
      3 epoll_ctl
      3 recvmsg
      4 clock_gettime
      4 epoll_wait
      7 getsockopt
    496 read
  30535 fstat
  33505 close
  39334 getdents64
  40030 fcntl
  45839 openat
  98565 readlinkat

This is a serious usability problem because of the perceived
delay during interactive work.

This behaviour is observed on several installations of the
up-to-date Debian Buster. This seems to be a regression compared
to the Stretch version:

# systemctl --version 
systemd 232
+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP
+LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID
+ELFUTILS +KMOD +IDN
# time systemctl list-unit-files | wc
    252     505   12274

real	0m0.057s
user	0m0.000s
sys	0m0.004s
# time systemctl --state=enabled list-unit-files | wc
     36      73    1179

real	0m0.059s
user	0m0.000s
sys	0m0.000s

Looking at some versions in between (234, 237), the regression
seems to be cumulative, rather than something that happened in a
single commit.

Best regards,

Dejan


*** Reporter, please consider answering these questions, where appropriate ***

   * What led up to the situation?
   * What exactly did you do (or not do) that was effective (or
     ineffective)?
   * What was the outcome of this action?
   * What outcome did you expect instead?

*** End of the template - remove these template lines ***


-- Package-specific info:

-- System Information:
Debian Release: 10.2
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: amd64 (x86_64)
Foreign Architectures: i386

Kernel: Linux 4.19.0-6-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US:en (charmap=UTF-8)
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled

Versions of packages systemd depends on:
ii  adduser          3.118
ii  libacl1          2.2.53-4
ii  libapparmor1     2.13.2-10
ii  libaudit1        1:2.8.4-3
ii  libblkid1        2.33.1-0.1
ii  libc6            2.28-10
ii  libcap2          1:2.25-2
ii  libcryptsetup12  2:2.1.0-5+deb10u2
ii  libgcrypt20      1.8.4-5
ii  libgnutls30      3.6.7-4
ii  libgpg-error0    1.35-1
ii  libidn11         1.33-2.2
ii  libip4tc0        1.8.2-4
ii  libkmod2         26-1
ii  liblz4-1         1.8.3-1
ii  liblzma5         5.2.4-1
ii  libmount1        2.33.1-0.1
ii  libpam0g         1.3.1-5
ii  libseccomp2      2.3.3-4
ii  libselinux1      2.8-1+b1
ii  libsystemd0      241-7~deb10u2
ii  mount            2.33.1-0.1
ii  util-linux       2.33.1-0.1

Versions of packages systemd recommends:
ii  dbus            1.12.16-1
ii  libpam-systemd  241-7~deb10u2

Versions of packages systemd suggests:
ii  policykit-1        0.105-25
ii  systemd-container  241-7~deb10u2

Versions of packages systemd is related to:
pn  dracut           <none>
ii  initramfs-tools  0.133+deb10u1
ii  udev             241-7~deb10u2

-- no debconf information



More information about the Pkg-systemd-maintainers mailing list