Load Balancing
Â
Load balancing is good to use when you want to spread the load across multiple end points. This allows you to share the load an not have one end point processing a disproportional amount of calls. To load balance NSG uses mod_distributor which basically returns a randomly selected string from the load balance list you provide. Below is more details and how to implement it.Â
The dial plan is located at
 /usr/local/nsg/conf/dialplan/default.xml, edit this file and use the example below to implement load balancing across multiple TDM groups (SS7 or PRI).
 <action application="set" data="pri_group=${distributor(pri)}"/>  |
 2. The example below to implement load balancing across multiple SIP devices.
 <action application="set" data="sip_trunk=${distributor(sip)}"/>  |
 3. Below is how to define the different strings that will be substituted whenÂ
${distributor(X)} is called. This file should be located at /usr/local/nsg/conf/autoload_configs/distributor.conf.xml and in most cases will need to be created.Â
<?xml version="1.0" encoding="UTF-8"?> Â |
Ensure you edit the
 /usr/local/nsg/conf/autoload_configs/modules.conf file and add the line below so this way mod_distributor is loaded when NSG starts.Â
Â
More InfoÂ
When ${distributor(pri)} is called in the set function this load balances between the different items in the list for "pri". Each item there has a weight and most of the time this will be evenly weighted. In this case above this means ${distributor(pri)} will evaluate to "g2" or "g3" as these are the two items in the list. For the SIP example ${distributor(sip)} will evaluate to 1.1.1.1 or 2.2.2.2.Â
Depending the knowledge of the NSG dial plan some items above may be unclear. If you have any questions please contact support support.sangoma.com.
Â
Â