Extremely high CPU steal in containers with raspberry pi 3B+

I’ve got a raspberry pi 3 B+ running a fresh install of Raspbian 10 and I also installed LXD using a snap package.

There’s one LXC container on my machine running pihole.

The container is very slow to do basically anything even though it’s not under any appreciable load. If I check top inside of the container, I see that the CPU steal time is 99%.

The host is doing basically nothing besides running this container.

output of top on host:

top - 15:46:10 up 20 days, 17:11, 2 users, load average: 0.38, 1.96, 3.19
Tasks: 169 total, 1 running, 168 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.2 us, 0.2 sy, 0.0 ni, 98.4 id, 1.1 wa, 0.0 hi, 0.1 si, 0.0 st
MiB Mem : 926.8 total, 46.9 free, 222.0 used, 657.8 buff/cache
MiB Swap: 100.0 total, 81.5 free, 18.5 used. 637.2 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
697 pi 20 0 10220 3052 2544 R 1.0 0.3 0:00.73 top
416 root 20 0 28596 1316 1212 S 0.3 0.1 4:17.39 rngd
32458 1000033 20 0 188540 9316 5980 S 0.3 1.0 0:00.71 php-cgi
1 root 20 0 34744 6456 5104 S 0.0 0.7 0:47.88 systemd
2 root 20 0 0 0 0 S 0.0 0.0 0:03.58 kthreadd
3 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_gp
4 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 rcu_par_gp
8 root 0 -20 0 0 0 I 0.0 0.0 0:00.00 mm_percpu_wq

output of top in the container:

top - 14:47:09 up 20 days, 17:12, 0 users, load average: 0.38, 1.67, 3.01
Tasks: 23 total, 1 running, 22 sleeping, 0 stopped, 0 zombie
%Cpu(s): 0.0 us, 0.0 sy, 0.3 ni, 0.0 id, 0.0 wa, 0.0 hi, 0.0 si, 99.7 st
MiB Mem : 926.8 total, 46.9 free, 222.0 used, 657.9 buff/cache
MiB Swap: 100.0 total, 81.5 free, 18.5 used. 637.2 avail Mem

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
22744 www-data 20 0 188540 9384 5980 S 0.3 1.0 0:00.82 php-cgi
22745 www-data 20 0 188540 9316 5980 S 0.3 1.0 0:00.82 php-cgi
22748 www-data 20 0 188540 9316 5980 S 0.3 1.0 0:00.83 php-cgi
22853 pihole 20 0 53360 6072 2820 S 0.3 0.6 0:01.41 pihole-FTL
23453 root 20 0 8388 2480 2112 R 0.3 0.3 0:00.03 top
1 root 20 0 33656 7180 5380 S 0.0 0.8 1:15.39 systemd
43 root 20 0 36892 10596 9856 S 0.0 1.1 0:45.65 systemd-journal
77 root 20 0 15100 2412 1952 S 0.0 0.3 0:05.53 systemd-udevd

The only configuration I’ve done is set my default profile to use a macvlan.

Is there possibly something I need to correctly configure for my containers to run correctly?

Let me know if there’s any more info I can provide.

That CPu steal result is almost certainly an artifact of lxcfs and not the actual issue (so just mis-reporting).