2011/3/29 Daniel Veillard <veillard(a)redhat.com>:
On Tue, Mar 29, 2011 at 02:32:18PM +0800, Osier Yang wrote:
> Example of cputune XML:
> <cputune>
> <shares>2048</shares>
> <vcpupin vcpu='0' cpuset='0-4,^1'/>
> <vcpupin vcpu='1' cpuset='1,3'/>
> <vcpupin vcpu='2' cpuset='0,2'/>
> </cputune>
>
> "shares" is to define the the proportional weighted cpu share
> for the domain.
Hum, what does "2048" there means ? I assume there is an unit but
it's not defined. Can we get a precide definition of the semantic of
the shares construct. If I were to use it I need to know what it means,
and I can't just from that description. Drivers in QEmu and LXC just
pass that down to linux, but it still doesn't provide a semantic for
it and "whatever linux implements at the time" is not really a good
answer.
In case of ESX the CPU share is a relative number without a unit. From
the vSphere API docs [1]:
"The number of shares allocated. Used to determine resource allocation
in case of resource contention. [...]. There is no unit for this
value. It is a relative measure based on the settings for other
[virtual machines]."
A domain with CPU share 2048 will get twice as much CPU time as a
domain with CPU share 1024. The same is true for a domain with 20 and
a domain with 10. The only thing that matters is the relation, not the
absolute value.
Also in case of ESX the shares value is only relevant in case of
contention for CPU time between multiple domains.
The same pattern applies to memory.
[1]
http://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/v...
Matthias