Tunable parameters control how well the Network Load Balancing Software distributes outbound packets and how it balances inbound packets. This chapter describes these parameters in these sections:
Network Load Balancing Software interface names are as follows:
nlb# lb0 lb1 ... |
The Network Load Balancing Software takes a rolling average of source and destination IP addresses and port numbers: after taking the first average, subsequent averages can be tuned, as explained in “Adjusting the Average Weight”. The software then applies a hash function and collapses the result to a 32-bit number so that it can send related packets out on the same interface.
The Network Load Balancing Software has tunable parameters for adjusting the hash function multiplier, number of devices to configure, and load balancing. Reset these parameters with systune; for information, see its man page, systune(1M).
All of the tuning parameters are dynamic except the of lb_devices parameter.
The Network Load Balancing Software tunable parameters are as follows:
| lb_hash_multiplier | Hash function multiplier, which selects the output interface. The default multiplier is 612542337. For example:
| ||
| lb_devices | Maximum number of load-balancing devices to be configured when the system is booted. The default is 1; range is 1 to 10. This example configures the software for three active devices:
For the new setting to take effect, reconfigure the kernel and reboot. See “Network Load Balancing Software and the Shell Command File /etc/init.d/network” in Chapter 2 for information on setting the number of load-balancing devices. | ||
| lb_balance_period | Period in milliseconds used for input load balancing. This variable determines how often the input-balancing algorithm is executed. The default is 1000 ms (that is, one second); the range is 100 to 600,000 ms. See “Adjusting the Balance Period” for instructions on adjusting this parameter. | ||
| lb_balance_thresh | Threshold for mean deviation in input byte counts above which input load balancing is triggered. The balance period is set in milliseconds. See “Adjusting the Balance Threshold Value” for instructions on adjusting this parameter. | ||
| lb_average_weight | Weighting in units of 100 used to calculate the rolling load averages for the interfaces. See “Adjusting the Average Weight” for instructions on adjusting this parameter | ||
| lb_ failure_interval | The interval in milliseconds that Network Load Balancing Software uses detect link failures. This determines how often the failure detection process will check the status of the underlying links on an Network Load Balancing Software device for failure. By default, the value of this parameter is 10000. The minimum is 100. The maximum is 60000. In general, this value should be greater than lb_balance_period. | ||
| lb_aggressive_failure | Use an aggressive failure detection method. This method consists of probing each interface attached to each load balancing device on each failure detection round. This parameter can be either 0 (off) or 1 (on). By default it is 0. | ||
| lb_fail_thresh | This is a threshold for the number of hosts which must be assigned to an interface for input before a link failure will be triggered by anything other than an ENETDOWN error from the interface or an EHOSTDOWN with IFF_UP not set in the interface flags. The default value for this is 1. | ||
| lb_check_count | This is the number of failure detection rounds in which an interface must have an input load and input load average of 0 before the link is probed for failure. The default value is 3. Setting this to 0 will cause the link to be probed each time the load average drops to 0. | ||
| lb_debug | Set the debugging level for load balancing devices. | ||
| lb_use_linkdown | Use the absence of the IFF_LINKDOWN flag on an interface as an indicator that the interface can be enabled after having been identified as failing. This is for compatibility with older IRIX releases where IFF_LINKDOWN was not implemented for all Ethernet interfaces. |
In the event of an error, the time it takes for Network Load Balancing Software to recover depends upon network activity and the settings of the tuning parameters for Network Load Balancing Software detection and recovery. These primary tuning parameters are described in this section. For more detail information, see the nlb(7) man page and /var/sysgen/mtune/if_lb file.
The primary tuning parameters are, as follows:
| lb_failure_interval | Failure detection interval in milliseconds. | |
| lb_aggressive_failure |
Use the aggressive failure detection method of probing each interface on each failure detection round. | ||
| lb_fail_thresh | This is a threshold for the number of hosts which must be assigned to an interface for input before a link failure will be triggered by anything other than an ENETDOWN error from the interface or an EHOSTDOWN with IFF_UP not set in the interface flags. | |
| lb_check_count | | |
| lb_debug | Set Network Load Balancing Software debugging to the desired level the valid settings are defined in the bsd/sys/if_lb.h file. This parameter has only a default setting, no maximum or minimum, | |
| lb_use_linkdown | Use the absence of the IFF_LINKDOWN flag on an interface as an indicator that the interface can be enabled (this is for compatibility with older IRIX releases where IFF_LINKDOWN was not implemented for all Ethernet interfaces). Off by default; set to 1 to turn this on. |
In addition, the failure detection time when the lb_aggressive_failure parameter is not set is affected by the following tuning paramaters for input balancing:
| lb_average_weight | The weighting in units of 100 used to calculate the rolling load averages for the interfaces. The averages are calculated from the input packet counts for each interface. | |
| lb_balance_thresh | |
The Network Load Balancing Software monitors packet count on the physical interfaces and reassigns clients depending on the load. The averages are calculated from the input packet counts for each interface. You can control this process by adjusting these parameters:
| Note: These tuning parameters do not apply when using static trunking. |
the balance period, which determines when the snapshot is taken for the rolling average
the threshold for mean deviation in input byte counts: this parameter determines when load balancing is triggered
the average weight used for calculating the rolling load averages for the interfaces
The rest of this section explains how to adjust these parameters.
The balance period determines how often the input-balancing algorithm is executed. More frequent execution increases overhead proportionally. The default is 1000 ms (that is, one second).
To reset the balance period, set lb_balance_period to the desired number of milliseconds (100 to 600,000); for example:
systune lb_balance_period 100000 |
The balance threshold value determines when load balancing is triggered; it is the threshold for mean deviation in input packet counts above which input load balancing is triggered. The Network Load Balancing Software calculates mean deviation, which should be less than the balance threshold.
When the mean absolute deviation, expressed as a percentage of the mean input load, exceeds this threshold, the Network Load Balancing Software attempts to balance the load by assigning a client another MAC address.
Setting the balance threshold value to a low number can result in a better input balance. However, such input balance might be impossible to achieve because the software continually moves clients from one MAC address to another.
The default balance threshold is 1%; the range is 1 to 100,000%. For example:
systune lb_balance_threshold 100 |
The Network Load Balancing Software uses the following formula to calculate the rolling average:
where
and
| S(n) | The approximate average of n samples. | |
| l(n) | The nth sample. | |
| k | The tunable parameter, an integer that is the average weight. Default is 50; range is 0 to 99. |
For example:
systune lb_average_weight 35 |
If k is 0, S(n) is always l(n), the instantaneous load. As k increases, l(n) provides less and S(n-1) provides more of the value of S(n). The calculation uses k% of S(n-1) and 100-k% of l(n).