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).
The Network Load Balancing Software tunable parameters are as follows:
| lb_hash_multiplier |
| ||
| 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 | | ||
| lb_balance_thresh | | ||
| lb_average_weight |
|
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:
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_period 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).