Configuring Bandwidth Management
The Traffic Manager's bandwidth management features are provided via the Catalog. This means that you may add more than one Bandwidth Management Class, each with its own limits. It also means that the choice of Bandwidth Management Class can be made through a TrafficScript rule, providing greater flexibility for situations where it is helpful to distinguish between requests to the same virtual server. For example, the Traffic Manager's Bandwidth Management system can be used to apply different limits for CGI requests than for image requests (see examples, below).
If you have a cluster of more than one Traffic Manager, the Bandwidth Management system takes this into account. You do not need to make adjustments when new servers are being added, as this is done automatically.
Adding a Bandwidth Class to the Catalog
To add a Bandwidth Management class to the Catalog, click Catalogs > Bandwidth Classes.
The Traffic Manager now shows a list of the existing Bandwidth Management classes, if any, and provides a box where you can create a new Bandwidth Management class.
Type a name into the box and click Create Class. The Traffic Manager now displays the settings page for this new class. You can select the maximum bandwidth and the limit sharing options.
To select the maximum bandwidth limit you can either:
•Select a predefined value from the drop-down list.
•Select Custom from the drop-down list and then enter your value, in kbits/second, in the box provided.
There are three possible modes for how the bandwidth class shares out bandwidth between connections:
•Each connection is limited to the maximum rate: No sharing is enforced, and all users of this class on all Traffic Managers will adhere to the maximum bandwidth limit set. This is useful when delivering video / audio streams to individual clients.
•Bandwidth is shared per Traffic Manager: The limit is shared amongst all users of the bandwidth class on each separate Traffic Manager. If you have a limit of 1 mbps and three Traffic Managers, each could deliver up to 1 mbps, giving a total of 3 mbps.
•Bandwidth is shared across all Traffic Managers: The limit is shared among all users of the bandwidth class across all Traffic Managers. With a limit of 1 mbps and three Traffic Managers, the cluster will only deliver 1 mbps total. Note that the limit is allocated dynamically - each Traffic Manager will be capable of using the full 1 mbps if the others are idle.
Click Update to commit your changes.
Unlike storage or memory capacity, network throughput is conventionally measured in factors of 1000 (not 1024).
Assigning a Bandwidth Class to a Virtual Server
A bandwidth management class that is assigned to a virtual server limits the bandwidth that the virtual server can use when sending response data to a client.
Configuration
To assign a Bandwidth Management class to a virtual server, click Services > Virtual Servers. Choose the virtual server from the list of available servers, and click the Edit button.
Next, click Classes and locate the section entitled “Bandwidth Management”. Use the radio buttons to select one of the available Bandwidth Management classes.
Click Update at the bottom of the page to commit your change. The virtual server begins using this Bandwidth Management class immediately.
If you do not have any Bandwidth Management classes, the only option displayed is “none configured”. To add a Bandwidth Management class, click Create New Bandwidth Management Class.
Assigning a Bandwidth Class to a Pool
A bandwidth management class that is assigned to a pool will limit the bandwidth that the pool can use when sending request data to a node.
Configuration
To assign a Bandwidth Management Class to a pool, click Services > Pools. Choose the pool from the list of available servers, and click the Edit button.
Next, click Bandwidth Management. Use the radio buttons to select one of the Bandwidth Management classes.
Click Update at the bottom of the page to commit your change. The pool begins using this Bandwidth Management class immediately.
If you do not have any Bandwidth Management classes, the only option displayed is “none configured”. To add a Bandwidth Management class, click Create New Bandwidth Management Class.
Using TrafficScript to Select a Bandwidth Class
The bandwidth management class can also be selected per request, using either of the TrafficScript functions request.setBandwidthClass() and response.setBandwidthClass(). These functions affect the “to-node” and “to-client” bandwidth respectively.
A Bandwidth Management class can be applied at any point in a TrafficScript rule, and overrides the virtual server's own settings if they exist.
For example, the following TrafficScript response rule selects the “downloads” Bandwidth Management class for responses which are large, or are from the “/downloads/” part of the site:
# This must be used as a response rule, because we
# want to determine the response content length...
$url = http.getPath();
$clen = http.getResponseHeader( "Content-Length" );
if( string.startsWith( $url, "/downloads") ||
$clen >= 100*1024 ) {
response.setBandwidthClass( "downloads" );
}