Re: [RFC] CPU hard limits

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Bharata B Rao wrote:
Another way is to place the 8 groups in a container group, and limit that to 80%. But that doesn't work if I want to provide guarantees to several groups.

Hmm why not ? Reduce the guarantee of the container group and provide
the same to additional groups ?

This method produces suboptimal results:

$ cgroup-limits 10 10 0
[50.0, 50.0, 40.0]

I want to provide two 10% guaranteed groups and one best-effort group. Using the limits method, no group can now use more than 50% of the resources. However, having the first group use 90% of the resources does not violate any guarantees, but it not allowed by the solution.

#!/usr/bin/python

def calculate_limits(g, R):
   N = len(g)
   if N == 1:
       return [R]

   s = sum([R - gi for gi in g])
   return [(s - (R - gi) - (N - 2) * (R - gi)) / (N - 1)
           for gi in g]

import sys
print calculate_limits([float(x) for x in sys.argv[1:]], 100)

--
I have a truly marvellous patch that fixes the bug which this
signature is too narrow to contain.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux