Limits.cpu_allowance doesn't seem to work on a dual CPU node

I implemented a throttling mechism based on thermocouple temperature readings to reduce the cpu usage of all running containers by using cpu_alllowance. My development box was an old single CPU motherboard and it worked perfectly. I’m using ubuntu server 20.04 LTE for all my installs.

I implemented a monitoring script for the thermocouples which feeds into collectd then configured collectd with a warning threshold and a failure threshold. Worked perfectly including removing the cpu_allowance once the CPU went outside of the abnormal temps…

However now that I’m testing on deployment machines… 2xXeon E5 V3 chips on a Supermicro X10DRi motherboard. I find that the CPU allowance has no effect what so ever.

So If I set a limits.cpu_allowance of “10ms/100ms” I would expect the target container to get 10ms per 100ms of CPU on a single CPU. Not use all of the CPU’s its configured for a 100%?

How is the cpu_allow implemented and why would it not work?, Is it todo with kernel support CPU chipset or something else?

What can I do to find out or fix this issue?

10ms/100ms should indeed get you 10% of a single CPU worth of time, which CPU it is will vary based on tasks and wherever the scheduler feels like putting you though.

On a system with 4 CPU threads, running 4 copies of (yes | sha1sum) will completely burn the CPU. Setting limits.cpu.allowance shows me all CPU at around 2-3% usage on an otherwise idle system, so around 10% of total resources.

Setting both limits.cpu=0-0 and limits.cpu.allowance to 10ms/100ms does then show just the first CPU being used at around 10%.