I'm creating this PR against workload branch because I mistakenly branched it off of workload instead of master. sorry...
Here's a summary:
I'm reserving a fixed 4GB memory for other processes in the cluster. So the maximum total amount of memory VMs can get is total_machine_memory - 4GB.
VmAppConfig now has a vcpu_count field in additional to the cpu_share field that was originally there. vcpu_count is passed into VmConfig to set the number of vCPUs, whereas cpu_share is passed into cgroup to control cpu share of the VM process.
cpu_share is calculated as VM_mem_size / 128MB. For example, a 256MB VM's cpu_share is 2.
vcpu_count is calculated as ceil(VM_mem_size / one_hyperthread_mem_size), where one_hyperthread_mem_size = (total_machine_memory - 4GB) / num_of_hyperthreads.
I'm creating this PR against
workload
branch because I mistakenly branched it off ofworkload
instead ofmaster
. sorry...Here's a summary:
total_machine_memory - 4GB
.VmAppConfig
now has avcpu_count
field in additional to thecpu_share
field that was originally there.vcpu_count
is passed intoVmConfig
to set the number of vCPUs, whereascpu_share
is passed into cgroup to control cpu share of the VM process.cpu_share
is calculated asVM_mem_size / 128MB
. For example, a 256MB VM'scpu_share
is 2.vcpu_count
is calculated asceil(VM_mem_size / one_hyperthread_mem_size)
, whereone_hyperthread_mem_size = (total_machine_memory - 4GB) / num_of_hyperthreads
.