Browse code

modules: readme files regenerated - dispatcher ... [skip ci]

Kamailio Dev authored on 19/11/2020 16:01:16
Showing 1 changed files
... ...
@@ -188,17 +188,18 @@ Federico Cabiddu
188 188
    1.40. Set the “ds_db_extra_attrs” parameter
189 189
    1.41. Set the “ds_load_mode” parameter
190 190
    1.42. Set reload_delta parameter
191
-   1.43. ds_select_dst usage
192
-   1.44. configuring load balancing with congestion detection
193
-   1.45. ds_select_domain usage
194
-   1.46. ds_select usage
195
-   1.47. ds_select_routes usage
196
-   1.48. ds_mark_dst usage
197
-   1.49. ds_list_exists usage
198
-   1.50. ds_is_from_list usage
199
-   1.51. ds_load_unset usage
200
-   1.52. dispatcher list file
201
-   1.53. Kamailio config script - sample dispatcher usage
191
+   1.43. latency_optimized_dispatching usage
192
+   1.44. ds_select_dst usage
193
+   1.45. configuring load balancing with congestion detection
194
+   1.46. ds_select_domain usage
195
+   1.47. ds_select usage
196
+   1.48. ds_select_routes usage
197
+   1.49. ds_mark_dst usage
198
+   1.50. ds_list_exists usage
199
+   1.51. ds_is_from_list usage
200
+   1.52. ds_load_unset usage
201
+   1.53. dispatcher list file
202
+   1.54. Kamailio config script - sample dispatcher usage
202 203
 
203 204
 Chapter 1. Admin Guide
204 205
 
... ...
@@ -1090,7 +1091,7 @@ modparam("dispatcher", "reload_delta", 1)
1090 1091
             1/2/1 will be distributed as 25/50/25. After third host
1091 1092
             failing distribution will be changed to 33/67/0.
1092 1093
             Using this algorithm, you can also enable congestion control
1093
-            by setting the attibute 'cc=1', when 'cc' is enabled the
1094
+            by setting the attribute 'cc=1', when 'cc' is enabled the
1094 1095
             'weight' attribute will also be used to control congestion
1095 1096
             tolerance. When facing congestion the weight of a gateway is
1096 1097
             lowered by 1 for every ms of estimated congestion, a 'rweight'
... ...
@@ -1105,6 +1106,34 @@ modparam("dispatcher", "reload_delta", 1)
1105 1106
             forking). Note that the XAVPs are no longer set with the
1106 1107
             values of the destination records, no re-routing making sense
1107 1108
             in this case.
1109
+          + “13” - latency optimized dispatching
1110
+            - The algorithm will load balance using round-robin
1111
+            prioritizing the gateways with the highest priority.
1112
+            - If ds_ping_latency_stats is active the algorithm will adjust
1113
+            the priority of the gateway automatically, the priority will
1114
+            be lowered by 1 point every time the latency ms is as high as
1115
+            the priority.
1116
+            - If the attribute 'cc=1' is set, the latency used is
1117
+            congestion ms : estimate (current latency ms) - average
1118
+            (normal condition latency ms).
1119
+            Example 1.43. latency_optimized_dispatching usage
1120
+Using this simple formula :
1121
+    ADJUSTED_PRIORITY = PRIORITY - (ESTIMATED_LATENCY_MS/PRIORITY)
1122
+
1123
+GATEWAY | PRIORITY | ESTIMATED | ADJUSTED | LOAD
1124
+   #    |          |  LATENCY  | PRIORITY | DISTRIBUTION
1125
+   1    |    30    |    21     |    30    | 33%
1126
+   2    |    30    |    91     |    27    | 0%
1127
+   3    |    30    |    61     |    28    | 0%
1128
+   4    |    30    |    19     |    30    | 33%
1129
+   5    |    30    |    32     |    29    | 0%
1130
+   6    |    30    |    0      |    30    | 33%
1131
+   7    |    30    |    201    |    24    | 0%
1132
+
1133
+
1134
+With congestion control the formula becomes :
1135
+    CONGESTION_MS = CURRENT_LATENCY_MS - NORMAL_CONDITION_LATENCY_MS
1136
+    ADJUSTED_PRIORITY = PRIORITY - (CONGESTION_MS/PRIORITY)
1108 1137
           + “X” - if the algorithm is not implemented, the first entry in
1109 1138
             set is chosen.
1110 1139
      * limit - the maximum number of items to be stored in XAVP list for
... ...
@@ -1113,7 +1142,7 @@ modparam("dispatcher", "reload_delta", 1)
1113 1142
 
1114 1143
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
1115 1144
 
1116
-   Example 1.43. ds_select_dst usage
1145
+   Example 1.44. ds_select_dst usage
1117 1146
 ...
1118 1147
 ds_select_dst("1", "0");
1119 1148
 ...
... ...
@@ -1123,7 +1152,7 @@ ds_select_dst("1", "$var(a)");
1123 1152
 ds_select_dst("1", "4", "3");
1124 1153
 ...
1125 1154
 
1126
-   Example 1.44. configuring load balancing with congestion detection
1155
+   Example 1.45. configuring load balancing with congestion detection
1127 1156
 ...
1128 1157
 # sample of SQL provisionning statements
1129 1158
 INSERT INTO "dispatcher"
... ...
@@ -1177,7 +1206,7 @@ DEST: {
1177 1206
 
1178 1207
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
1179 1208
 
1180
-   Example 1.45. ds_select_domain usage
1209
+   Example 1.46. ds_select_domain usage
1181 1210
 ...
1182 1211
 $var(a) = 4;
1183 1212
 if(ds_select_domain("1", "$var(a)")) {
... ...
@@ -1201,7 +1230,7 @@ if(ds_select_domain("1", "$var(a)")) {
1201 1230
 
1202 1231
    This function can be used from ANY_ROUTE.
1203 1232
 
1204
-   Example 1.46. ds_select usage
1233
+   Example 1.47. ds_select usage
1205 1234
 ...
1206 1235
 $var(a) = 4;
1207 1236
 if(ds_select("1", "$var(a)")) {
... ...
@@ -1244,7 +1273,7 @@ if(ds_select("1", "$var(a)")) {
1244 1273
 
1245 1274
    This function can be used from ANY_ROUTE.
1246 1275
 
1247
-   Example 1.47. ds_select_routes usage
1276
+   Example 1.48. ds_select_routes usage
1248 1277
 ...
1249 1278
 $var(alg) = 4;
1250 1279
 $var(limit) = 8;
... ...
@@ -1319,7 +1348,7 @@ failure_route[REROUTE] {
1319 1348
 
1320 1349
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE.
1321 1350
 
1322
-   Example 1.48. ds_mark_dst usage
1351
+   Example 1.49. ds_mark_dst usage
1323 1352
 ...
1324 1353
 failure_route[tryagain] {
1325 1354
 ...
... ...
@@ -1341,7 +1370,7 @@ failure_route[tryagain] {
1341 1370
 
1342 1371
    This function can be used from ANY_ROUTE.
1343 1372
 
1344
-   Example 1.49. ds_list_exists usage
1373
+   Example 1.50. ds_list_exists usage
1345 1374
 ...
1346 1375
 if(ds_list_exists("10")) {
1347 1376
     ...
... ...
@@ -1385,7 +1414,7 @@ if(ds_list_exists("10")) {
1385 1414
 
1386 1415
    This function can be used from ANY_ROUTE.
1387 1416
 
1388
-   Example 1.50. ds_is_from_list usage
1417
+   Example 1.51. ds_is_from_list usage
1389 1418
 ...
1390 1419
 if(ds_is_from_list()) {
1391 1420
     ...
... ...
@@ -1419,7 +1448,7 @@ if(ds_is_from_list("10", "3", "sip:127.0.0.1:5080")) {
1419 1448
    This function can be used from REQUEST_ROUTE, FAILURE_ROUTE,
1420 1449
    BRANCH_ROUTE and ONREPLY_ROUTE.
1421 1450
 
1422
-   Example 1.51. ds_load_unset usage
1451
+   Example 1.52. ds_load_unset usage
1423 1452
 ...
1424 1453
 route {
1425 1454
     ...
... ...
@@ -1717,7 +1746,7 @@ setid(int) destination(sip uri) flags(int,opt) priority(int,opt) attrs(str,opt)
1717 1746
    For database, each element of a line resides in a different column.
1718 1747
    Next is a dispatcher.list file example:
1719 1748
 
1720
-   Example 1.52. dispatcher list file
1749
+   Example 1.53. dispatcher list file
1721 1750
 ...
1722 1751
 #
1723 1752
 # dispatcher destination sets (groups)
... ...
@@ -1742,7 +1771,7 @@ r,opt)
1742 1771
 
1743 1772
    Next listing shows a sample config for using the dispatcher module.
1744 1773
 
1745
-   Example 1.53. Kamailio config script - sample dispatcher usage
1774
+   Example 1.54. Kamailio config script - sample dispatcher usage
1746 1775
 ...
1747 1776
 #!KAMAILIO
1748 1777
 #