
Resource Management
255
www.vmware.com
bucket controls peak bandwidth during bursts. Each nfshaper instance can accept
parameters to control average bps, peak bps and burst size.
The procfs interface described in Using Network Filters is used to attach an
nfshaper instance to a virtual machine, detach an nfshaper instance from a
virtual machine, query the status of an nfshaper instance or issue a dynamic
command to an active nfshaper instance.
Commands
config <bpsAverage> <bpsPeak> <burstSize> [<periodPeak>]
Dynamically reconfigure the shaper to use the specified parameters: average
bandwidth of <bpsAverage> bits per second, peak bandwidth of <bpsPeak>
bits per second, maximum burst size of <burstSize> bytes and an optional peak
bandwidth enforcement period <periodPeak> in milliseconds. Each parameter
may optionally use the suffix k (1k = 1024) or m (1m = 1024k).
maxq <nPackets>
Dynamically set the maximum number of queued packets to <nPackets>.
reset
Dynamically reset shaper statistics.
Examples
Suppose that you want to attach a traffic shaper to limit the transmit bandwidth of
the virtual machine with ID 104. To create and attach a new shaper instance, issue an
xmitpush command as described in Using Network Filters on page 253. Note that
root privileges are required to attach a filter.
echo "104 nfshaper 1m 2m 160k" > \
/proc/vmware/filters/xmitpush
This attaches a traffic shaper with average bandwidth of 1Mbps, peak bandwidth of
2Mbps and maximum burst size of 160Kb.
Note: This command should be entered on a single line. Do not type the backslash.
To find the number of the attached nfshaper instance, query the network filtering
status, which contains a list of all filters attached to virtual machines:
cat /proc/vmware/filters/status
Suppose the reported status information indicates that the filter attached to virtual
machine 104 is nfshaper.2.104. The procfs node for this filter can be used to
obtain status information:
cat /proc/vmware/filters/xmit/nfshaper.2.104
Kommentare zu diesen Handbüchern