You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: articles/hpc-cache/client-load-balancing.md
+32-1Lines changed: 32 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -32,7 +32,9 @@ Read [Mount the Azure HPC Cache](hpc-cache-mount.md) for details.
32
32
33
33
## Use scripted load balancing
34
34
35
-
There are several ways to programmatically rotate client mounts among the available IP addresses.
35
+
There are several ways to programmatically rotate client mounts among the available IP addresses. Here are two examples.
36
+
37
+
### Mount command script cksum example
36
38
37
39
This example mount command uses the hash function ``cksum`` and the client host name to automatically distribute the client connections among all available IP addresses on your HPC Cache. If all of the client machines have unique host names, you can run this command on each client to ensure that all available mount points are used.
38
40
@@ -64,6 +66,35 @@ Here is an example of a populated client mount command:
64
66
mount -o hard,proto=tcp,mountproto=tcp,retry=30 $(X=(10.7.0.{1..3});echo${X[$(($(hostname|cksum|cut -f 1 -d ' ')%3))]}):/blob-target-1 /hpc-cache/blob1
65
67
```
66
68
69
+
### Round robin function example
70
+
71
+
This code example uses client IP addresses as a randomizing element to distribute clients to all of the HPC Cache's available IP addresses.
72
+
73
+
```bash
74
+
functionmount_round_robin() {
75
+
76
+
# to ensure the clients are spread out somewhat evenly the default
77
+
# mount point is based on this client's IP octet4 % number of HPC cache mount IPs.
78
+
79
+
declare -a MOUNT_IPS="($(echo ${NFS_IP_CSV}| sed "s/,/ /g"))"
retrycmd_if_failure 12 20 mount "${DEFAULT_MOUNT_POINT}"||exit 1
94
+
fi
95
+
}
96
+
```
97
+
67
98
## Use DNS load balancing
68
99
69
100
This section explains the basics of configuring a DNS system to distribute client connections to all of the mount points on your Azure HPC Cache. This method doesn't account for the amount of traffic each client generates, but it does make sure that clients are evenly spread out over all of the cache's interfaces instead of just using one or two.
0 commit comments