@stgraber, thank you for your comment.
According to my trials, I’ve not found any effective way to allocate isolated CPUs to lxd container as shown below. If any, please let me know…
ubuntu@r9:~$ lxc launch ubuntu:bionic bionic
Creating bionic
Starting bionic
ubuntu@r9:~$ lxc config set bionic limits.cpu 3,7,11,15,2,6,10,14
ubuntu@r9:~$ cat /proc/cmdline
BOOT_IMAGE=/boot/vmlinuz-4.15.0-51-generic root=UUID=341b9db3-0131-4ac8-92ff-1f9acc544ca4 ro hugepagesz=2M hugepages=32768 isolcpus=1,5,9,13,17,21,25,29,2,6,10,14,18,22,26,30 nohz_full=1,5,9,13,17,21,25,29,2,6,10,14,18,22,26,30 rcu_nocbs=1,5,9,13,17,21,25,29,2,6,10,14,18,22,26,30 iommu=pt intel_iommu=on
ubuntu@r9:~$ numactl -H
available: 4 nodes (0-3)
node 0 cpus: 0 4 8 12 16 20 24 28
node 0 size: 48278 MB
node 0 free: 30158 MB
node 1 cpus: 1 5 9 13 17 21 25 29
node 1 size: 48382 MB
node 1 free: 30697 MB
node 2 cpus: 2 6 10 14 18 22 26 30
node 2 size: 48382 MB
node 2 free: 30561 MB
node 3 cpus: 3 7 11 15 19 23 27 31
node 3 size: 48361 MB
node 3 free: 29784 MB
node distances:
node 0 1 2 3
0: 10 21 21 21
1: 21 10 21 21
2: 21 21 10 21
3: 21 21 21 10
ubuntu@r9:~$ lxc exec bionic – cat /proc/cpuinfo | grep processor
processor : 0
processor : 1
processor : 2
processor : 3
ubuntu@r9:~$ echo “3,7,11,15,2,6,10,14” | sudo tee /sys/fs/cgroup/cpuset/lxc/bionic/cpuset.cpus
3,7,11,15,2,6,10,14
tee: /sys/fs/cgroup/cpuset/lxc/bionic/cpuset.cpus: Permission denied
ubuntu@r9:~$ echo “3,7,11,15,2,6,10,14” | sudo tee /sys/fs/cgroup/cpuset/lxc/bionic/cpuset.effective_cpus
3,7,11,15,2,6,10,14
tee: /sys/fs/cgroup/cpuset/lxc/bionic/cpuset.effective_cpus: Invalid argument
ubuntu@r9:~$