Limit CPUs on LXC antlets

3 replies
lancem
210 posts

I'm on antMan 3.4.2 and AntsleOS 2.0.0 (Antsle XD Pro).

LXCs respect the Memory limits, but don't seem to pay attention to the CPU limit setting.

I have a plex LXC antlet set to 1 CPU, but when it starts transcoding, the antlse CPUs peg out 90+%

Is there another way or should I just switch to a KVM?

Thanks

daniel.luckStaff
551 posts

Hi LanceM:

Interesting.  I was not aware of this limitation with LXC's.  Can you try this on KVM and let us know?

What are you showing in status utilities such as top and htop?

lancem
210 posts

In an LXC, if I do top, it shows all CPUs of the antsle (16).  Also, doing

grep -i processor /proc/cpuinfo

also shows all the cpus of the antsle

But in a KVM, it only shows the CPUs I've allocated to it.

daniel.luckStaff
551 posts

Hi Lance:

You can try using CPU Passthrough function by modifying the antlet's XML (for KVM's):

virsh edit antlet_name

Change the <cpu mode=...> to look like this.
<cpu mode='host-passthrough' check='none'/>

Here's what mine looks like:
14 </features>
15 <cpu mode='host-passthrough' check='none'/>
16 <clock offset='localtime'>

We have done some internal testing with this function and performance was functionally similar.  Your experience may vary.

Log in to reply. New here? It takes a minute.