Hi, I seem to have a problem when creating a LXC container through virsh. While virsh -c lxc:/// dominfo <container> shows up (for example) 2 VCPUs as defined, if I run a CPU intensive task (such as stress --cpu 10) it will max out 10 CPU cores on the host. If I echo "0" > /cgroup/cpuset/libvirt/lxc/<domain>/cpuset.cpus then the container is properly confined to just one CPU core. Subsequently, running stress --cpu 10 only one core on the host is maxed out. Does anyone know what syntax/config I'm missing, while installing the lxc container via virsh..to ensure that the VCPUs are restricted to the number defined? Thanks in advance
Michal Privoznik
2015-Aug-13 08:07 UTC
Re: [libvirt-users] Libvirt LXC vcpu doesn't seem to work
On 12.08.2015 18:26, Dave Riches wrote:> Hi, > > I seem to have a problem when creating a LXC container through virsh. > > While virsh -c lxc:/// dominfo <container> shows up (for example) 2 > VCPUs as defined, if I run a CPU intensive task (such as stress --cpu > 10) it will max out 10 CPU cores on the host. > > If I echo "0" > /cgroup/cpuset/libvirt/lxc/<domain>/cpuset.cpus > > then the container is properly confined to just one CPU core. > Subsequently, running stress --cpu 10 only one core on the host is maxed > out. > > Does anyone know what syntax/config I'm missing, while installing the > lxc container via virsh..to ensure that the VCPUs are restricted to the > number defined? > > Thanks in advanceYeah, that has never worked. I guess you need to pin the vcpus and then it might work. As your own example proves. Michal
Apparently Analagous Threads
- Libvirt LXC and VCPU?
- virsh -c lxc:/// setvcpus and <vcpu> configuration fails
- Does libvirt lxc driver support "cpuset" attribute?
- Is there any virsh command to setup cpusettune for lxc?
- why CPU pinning doesn't take effect when using lxc-enter-namespace to run an application