The ListUnitFiles operations in systemd causing high CPU consumption and causing delays in other system operations and makes system unusable

Solution Verified - Updated -

Issue

  • ListUnitFiles impacts systemd a lot, causing high CPU consumption and delay in operations.
  • The "systemctl list-unit-files" command when run often, kills the system usability and makes system unusable, as CPU usage by systemd spikes up.

  • With RHEL8.7 / systemd-239-68.el8, we can see that the ListUnitFiles DBus operation is very costly.

  • When executing systemd under strace, we can observe that on a system having 145 units ("minimal installation" of RHEL8.7), the readlinkat/openat/getdents64 syscalls are called hundreds or even thousands of times on same files, causing high CPU consumption.

  • Overall CPU usage by systemd becomes high and impact other operations on the system and makes system unusable.

  • Consistent high CPU for PID 1
  • systemd consumes a lot of kernel space
  • Systemctl commands are hanging and timing out

Environment

  • Red Hat Enterprise Linux (RHEL) 8
  • systemd-239-68.el8
  • Red Hat Enterprise Linux (RHEL) 9

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content