Data Centers

Set bandwidth limits with VMware traffic shaping

Networking isn't usually the most contended resource, but you do have the ability to configure very granular throughput rules. Rick Vanover explains how in this blog post.

When it comes to provisioning resources for VMware virtual environments, I find myself being most careful about storage and memory first. I then become mindful of CPU over-subscription and looking for key indicators like CPU-ready. I don't spend much time watching network traffic as a contended resource, but I recently had a situation where that became a requirement.

One of the great features of VMware vSphere is the ability to set very granular shaping rules on the virtual switch or the port group. This granularity can help you provide additional segmentation without having other systems be subject to a traffic shaping rule as would the be situation if it only applied to a virtual switch. For the vNetwork Distributed Switch, this can be set as a bidirectional traffic shaping policy (VM to network and then network to VM). For the standard virtual network switch, the traffic shaping policy is basic; but, it still can be granular to each port group. Figure A below has a standard virtual switch set to have a peak and average bandwidth of approximately 8 Megabytes per second for an example situation for a web-facing virtual switch.

Figure A

Click to enlarge.

Now, the calculations here are bit complicated. The average bandwidth of 409 Kbits/sec specifies that the entire port group cannot exceed that rate, and each VM will be sharing the bandwidth with other virtual machines on that port group. Note also that this figure above has other port groups. They don't have traffic shaping, and don't apply to this limit.

If you ever configure a traffic shaping pattern for a virtual switch, I recommend that you do some throughput tests to ensure that the desired limits are put in place. Also check out VMware KB 1010593 for explanations on the traffic shaping concept terms.

Once you've configured the port group and the bandwidth values, the traffic shaping pattern is ready to go! It's important to note that this isn't the best way to segment a single VM to not exceed a certain amount of network connectivity, however (Network I/O Control may be the better feature).

How do you use traffic shaping for your VMware virtual machines? Share your configuration tips below.

About Rick Vanover

Rick Vanover is a software strategy specialist for Veeam Software, based in Columbus, Ohio. Rick has years of IT experience and focuses on virtualization, Windows-based server administration, and system hardware.

Editor's Picks

Free Newsletters, In your Inbox