Score:0

CPUAffinity in /etc/systemd/system.conf getting messed up when docker/snap is installed

ar flag

For some benchmarking purpose I need to set CPUAffinity for the entire system to limit all process to some cores lets say first 10 cores. This way I can do taskset to override the CPUAffinity and benchmark on a core which is not in the CPUAffinity list.

The reason for doing it is to make sure that during benchmarking of a software, we do not have any disturbance from other users or OS itself.

CPUAffinity was working fine until I upgraded the server from ubuntu 20.04 to ubuntu 22.04. Docker was installed earlier but it did not interfere with systemd cgroups. But now it does interfere and some how sets init affinity to all cores.

I have tried setting cgroup-driver of docker to systemd, it did not help. I might be also viewing the problem wrong.

To reproduce this issue, you just have to install a VM with ubuntu server 22.04, also install docker. Now even if you set CPUAffinity in /etc/systemd/system.conf it will not work. To fix this you will have to remove docker and snapd completely.

For me docker is needed so that's why I am trying to work around this issue.

Also an interesting fact ubuntu 22.04 desktop edition does not seems to have this issue out of box. But I didnt confirm if it has docker/snap installed by default.

Any way thanks for any help.

David avatar
cn flag
Docker is not installed by default snap is. Do you know the app works with Ubuntu 22.04?
Abhiram Shibu avatar
ar flag
Docker was installed with apt not snap. I tried both docker.io and docker-ce
Score:0
ar flag

There were 2 packages which were causing issues,

  1. SNAP (LXD)
  2. Docker

After uninstalling both of them, the behavior returned to normal.

I have replaced docker with podman, but if you run container as root in podman the problem will still return :-)

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.