You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cloudstack.apache.org by Hean Seng <he...@gmail.com> on 2020/08/13 17:22:02 UTC

Compute Offering - Network Rate

Hi

Cloudstack 4.14 ,  Advance Network with GiuestNetwork have Public IP

Create a compute offering with 10Mbps, but vm created stil able to burst to
200Mps

Any one know how to solve this



-- 
Regards,
Hean Seng

Re: Compute Offering - Network Rate

Posted by Eric Lee Green <er...@gmail.com>.
On 8/13/2020 10:22 AM, Hean Seng wrote:
> Hi
>
> Cloudstack 4.14 ,  Advance Network with GiuestNetwork have Public IP
>
> Create a compute offering with 10Mbps, but vm created stil able to burst to
> 200Mps
>
> Any one know how to solve this

The virtualization hypervisor is responsible for enforcing network 
limits. Which virtualization hypervisor are you using? Xen? KVM? VMware?

For KVM hosts, libvirt has the capability to throttle bandwidth. It has 
three knobs for inbound and outbound bandwidth -- average bandwidth, 
peak bandwidth, and burst number of bytes. To see the XML being 
generated for your virtual machine, turn on debugging on the agent on 
one of your hostsĀ  in /etc/cloudstack/agent/log4j-cloud.xml (change all 
INFO to DEBUG then restart the agent), then start the instance on that 
specific host. Then look for the XML in the log file in 
/var/log/cloudstack/agent/agent.log which should have a segment in it 
like this for the network interface: [note -- all file locations are for 
CentOS 7]


...
   *<bandwidth> <inbound average='1000' peak='5000' burst='5120'/> 
<outbound average='128' peak='256' burst='256'/> </bandwidth> ... *

For information on what that means:

https://libvirt.org/formatnetwork.html#elementQoS

Hmm, yeah, just checked the source.

if ((s_libvirtVersion >= 9004) && (_networkRateKBps > 0)) {// supported from libvirt 0.9.4 netBuilder.append("<bandwidth>\n");
     netBuilder.append("<inbound average='" +_networkRateKBps +"' peak='" +_networkRateKBps +"'/>\n");
     netBuilder.append("<outbound average='" +_networkRateKBps +"' peak='" +_networkRateKBps +"'/>\n");
     netBuilder.append("</bandwidth>\n");
}

According to the source code, average and peak for both inbound and 
outbound are set to the max bandwidth in the offering, while 'burst' is 
not defined. Note the limitation documented in the above libvirt 
document: the 'peak' is ignored in the outbound setting, because of 
Linux OS network layer limitations. Cloudstack properly produces the 
tag, but the KVM hypervisor ignores it. If the hypervisor ever actually 
respects the limit Cloudstack is sending it the right data, but 
Cloudstack can't force the hypervisor to do something it can't currently do.

In other words, the behavior you're seeing appears to be a result of 
limitations of KVM on Linux if that's the hypervisor you're using. 
Apparently only the 'average' is respected for outbound data traffic, 
meaning you'll be able to burst on outbound traffic and it'll be 
throttled only once the average exceeds the limit.