Scale Factor - Advanced Rule Processing

Introduction

In some cases it is necessary to limit connections based on the overall usage of the internet resource. Rather than use fixed speed limits, there may be a need to provide bandwidth to users at a rate that corresponds to the current system load.

Scale factor is used to provide percentage-based allocation between rules. It allows the administrator to give each rule an equal amount of bandwidth, or allocate bandwidth at a ratio relative to other rules that are in use.

Usage

The field is specified as a ratio rather than a percentage which allows seamless operation regardless of the number of rules. The ratio value is used by the system to determine how much bandwidth to allocate for the rule by comparing it to all other rules that are in use at the time.

The default value is 1 which gives the rule 1 unit of bandwidth for every other unit consumed by the entire system. For example if there are 3 rules in use, each with a ratio of 1, the rule will receive 33% of the bandwidth. If only two of those three rules are in use, it will receive 50% of the bandwidth.

The percentage of allocation is calculated by adding up the ratios of all the rules currently in use, and dividing the rule's ratio by that total. For example if the system has 4 rules in use with ratios that add up to 15, and the rule in question has a ratio of 3, then the percentage of bandwidth given to that rule is 3/15 or 20%.

In practice, most rules are given the default scale factor of 1, which means it will receive equal bandwidth to all other rules. In a simple example if there are ten rules that each have a scale factor of 1, they are given 1/10th of the bandwidth each.

Scale factor is only used when a rule has traffic flowing through it, otherwise it is ignored from any calculations. This has the effect of dynamically spreading bandwidth between active users only. Similarly, if a rule is not using its entire portion that has been allocated, the spare bandwidth is returned to the system for other traffic to use. This allows the internet resource to be used at full efficiency by preventing any unused gaps of bandwidth from developing.

Dynamic rules also make use of scale factor by giving each user an equal amount of bandwidth. This works by applying the rule's scale factor separately each queue of the dynamic rule. A common usage of dynamic rules is to create one that filters all users with a scale factor of 1, effectively giving equal bandwidth to all users.

User Interface

Scale factor is configured in the advanced processing tab for a rule. Enter a value between 1 and 255 to specify the allocation ratio. Most rules can be left at the default value of 1 (equal allocation).

Specifications

Name Value
Property Name Scale factor
Category Advanced Rule Processing
Values 1 to 255
Default 1
XML file rules.xml
XML name <rateRatio>
XML values Integer between 1 and 255 inclusive.