Public bug reported:

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@.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@.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@.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.

** Affects: systemd (Ubuntu)
     Importance: Undecided
         Status: New

** Affects: systemd (Ubuntu Bionic)
     Importance: Undecided
         Status: New

** Also affects: systemd (Ubuntu Bionic)
   Importance: Undecided
       Status: New

** Description changed:

  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@.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:
  
  |   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@.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@.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.

** Description changed:

  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@.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@.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@.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.

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, 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:
  New
Status in systemd source package in Bionic:
  New

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@.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@.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@.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

-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to