Jump to: navigation, search

InstanceResourceQuota

Revision as of 07:25, 10 October 2012 by Yaguang (talk)

Instance Resource Quota

How to set Server CPU,disk IO,Bandwidth consumption limit for instances using the new feather of nova. By using cgroup,libvirt can set the per instance CPU time consumption percent. and the instances's read_iops,read_byteps, write_iops,write_byteps.also libvirt support limit the instances in/out bandwidth.

blueprint https://blueprints.launchpad.net/nova/+spec/instance-resource-quota
commit https://review.openstack.org/#/c/14151/

Config Nova to use these feathers

Config IO limit for the specified instance type

 
nova-manage flavor set_key --name m1.small  --key read_bytes_sec --value 10240000
nova-manage flavor set_key --name m1.small  --key write_bytes_sec --value 10240000


CPU control params :cpu_shares,cpu_quota,cpu_period

shares The optional shares element specifies the proportional weighted share for the domain. If this is omitted, it defaults to the OS provided defaults. NB, There is no unit for the value, it's a relative measure based on the setting of other VM, e.g. A VM configured with value 2048 will get twice as much CPU time as a VM configured with value 1024. Since 0.9.0 period The optional period element specifies the enforcement interval(unit: microseconds). Within period, each vcpu of the domain will not be allowed to consume more than quota worth of runtime. The value should be in range [1000, 1000000]. A period with value 0 means no value. Only QEMU driver support since 0.9.4, LXC since 0.9.10 quota The optional quota element specifies the maximum allowed bandwidth(unit: microseconds). A domain with quota as any negative value indicates that the domain has infinite bandwidth, which means that it is not bandwidth controlled. The value should be in range [1000, 18446744073709551] or less than 0. A quota with value 0 means no value. You can use this feature to ensure that all vcpus run at the same speed. Only QEMU driver support since 0.9.4, LXC since 0.9.10

Config CPU limit for the specified instance type

nova-manage flavor set_key --name m1.small  --key cpu_quota --value 5000
nova-manage flavor set_key --name m1.small  --key cpu_period --value 2500


Config Bandwidth limit for instance network traffic

nova-manage flavor set_key --name m1.small  --key inboud_average --value 10240
nova-manage flavor set_key --name m1.small  --key outboud_average --value 10240


for the details about bandwidth params inbound_peak,inbound_burst,outbound_peak,outbound_burst refer to

http://libvirt.org/formatnetwork.html