[Bug 1904369] Re: systemd 100% CPU; constantly reading service for socket activation
Launchpad Bug Tracker
1904369 at bugs.launchpad.net
Wed Nov 18 09:23:13 UTC 2020
Status changed to 'Confirmed' because the bug affects multiple users.
** Changed in: systemd (Ubuntu Bionic)
Status: New => Confirmed
--
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:
Confirmed
Status in systemd source package in Bionic:
Confirmed
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