I recently moved to KVM. Previously I was using xen and its capping feature in credit scheduler. Where we can set a cpu cap for a VM. I was searching for a similar feature to set hard limits on a VM in KVM. I recently found that cgroups has a concept called quota which lets us set a hardlimit for VM (process) in kvm. I am currently using centos 6. I checked cgroups but I can see only the ability to provide cpu shares and not quotas.Even libvirt has the support for this feature from version 0.9.4(As per the site), I am currently using libvirt 0.9.4 but when I use the command to set cpu quota , I get invalid option error. Can someone please tell me what am I missing and what should I do to enable that feature in cgroups to set hardlimits. Thanks !

  • Sethu

Currently cpu.shares only define the lower bound of cpu allocation, defining the upper bound(aka capping) is called CPU bandwidth control in the Linux kernel community CPU bandwidth control for CFS. But I'm afraid this feature hasn't made its way to the mainline kernel yet, nevertheless the patch is available , for example the 7.2 version

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.