[Bug 1904369] Re: systemd 100% CPU; constantly reading service for socket activation

Haw Loeung 1904369 at bugs.launchpad.net
Fri Feb 19 23:40:53 UTC 2021


Sorry about not providing further details on this bug. We ended up
switching the last of our systems to xinetd so can no longer reproduce
and provide the information required.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/1904369

Title:
  systemd 100% CPU; constantly reading service for socket activation

Status in systemd package in Ubuntu:
  Incomplete
Status in systemd source package in Bionic:
  Incomplete

Bug description:
  Hi,

  We recently switched to using systemd's socket activation for per-
  client limits. The configs are as follows:

  | $ ls -la /etc/systemd/system/sockets.target.wants/rsyncd.socket
  | lrwxrwxrwx 1 root root 33 Aug 25 00:09 /etc/systemd/system/sockets.target.wants/rsyncd.socket -> /etc/systemd/system/rsyncd.socket

  | $ cat /etc/systemd/system/sockets.target.wants/rsyncd.socket
  | [Unit]
  | Description=rsync daemon (socket)
  | Conflicts=rsyncd.service
  |
  | [Socket]
  | ListenStream=873
  | Accept=yes
  | MaxConnections=85
  | MaxConnectionsPerSource=5
  | KeepAlive=true
  |
  | [Install]
  | WantedBy=sockets.target

  | $ cat /etc/systemd/system/rsyncd at .service
  | [Unit]
  | Description=rsync daemon
  | ConditionPathExists=/etc/rsyncd.conf
  |
  | [Service]
  | ExecStart=/usr/bin/rsync --daemon
  | StandardInput=socket
  |
  | [Install]
  | WantedBy=multi-user.target

  After a while, systemd runs hot consuming a whole CPU core:

  | $ top -p 1
  |   PID USER      PR  NI    VIRT    RES    SHR S  %CPU %MEM     TIME+ COMMAND
  |     1 root      20   0 2057476 251560   6264 R  99.7  0.1  17903:32 systemd

  strace shows it constantly doing this:

  | $ sudo strace -p 1
  | ...
  | openat(AT_FDCWD, "/etc/systemd/system/rsyncd at .service", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = 14
  | fcntl(14, F_GETFL)                      = 0x28000 (flags O_RDONLY|O_LARGEFILE|O_NOFOLLOW)
  | fstat(14, {st_mode=S_IFREG|0644, st_size=173, ...}) = 0
  | fstat(14, {st_mode=S_IFREG|0644, st_size=173, ...}) = 0
  | fstat(14, {st_mode=S_IFREG|0644, st_size=173, ...}) = 0
  | read(14, "[Unit]\nDescription=rsync daemon\n"..., 4096) = 173
  | read(14, "", 4096)                      = 0
  | close(14)                               = 0
  | openat(AT_FDCWD, "/etc/systemd/system/rsyncd at .service", O_RDONLY|O_NOCTTY|O_NOFOLLOW|O_CLOEXEC) = 14
  | fcntl(14, F_GETFL)                      = 0x28000 (flags O_RDONLY|O_LARGEFILE|O_NOFOLLOW)
  | fstat(14, {st_mode=S_IFREG|0644, st_size=173, ...}) = 0
  | fstat(14, {st_mode=S_IFREG|0644, st_size=173, ...}) = 0
  | fstat(14, {st_mode=S_IFREG|0644, st_size=173, ...}) = 0
  | read(14, "[Unit]\nDescription=rsync daemon\n"..., 4096) = 173
  | read(14, "", 4096)                      = 0
  | close(14)                               = 0
  | ^Cstrace: Process 1 detached

  This is with 237-3ubuntu10.43 on a host running Bionic.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/1904369/+subscriptions



More information about the foundations-bugs mailing list