[CloudXNS teaches you a few tricks] How to make multi-ip domain name configuration easy? (2)

In the previous section, we mentioned the convenience of line division brought by the powerful subdivision lines and private lines of CloudXNS to your multi-IP domain name configuration. In this section, we will bring you the things about multi-ip load balancing.

3: CloudXNS-specific record types perfectly help you load balance

Maybe you have already discovered that we have several record types that are different from other DNS resolution service providers: LINK, AX, CNAMEX, so have you tried these record types? For users with multiple ip configuration requirements, the editor will focus on introducing AX records to you.

X means eXtend, and AX means extended A record parsing, which is embodied in the load balancing of multiple A records in an arbitrary specified proportion. We know that the Local DNS server cluster will cache user requests. When you have multiple A records, it will randomly send one of these cached A records back to the user. In this way, we can't estimate the number of requests for each ip by users, and perhaps the traffic of these ips will be averaged over time. By using the AX record of CloudXNS, when there is a request to CloudXNS from LocalDNS, one of the values ​​is returned to it according to the preset ratio and passed to the user, and this ratio is controlled by the webmaster yourself.

Let Xiaobian take you to test it. First, configure the www.chinatesters.cn domain name in the CloudXNS system as shown in the following figure:

7

The priority represents the preset ratio. In the configuration above, the ratio of the recorded values ​​2.2.2.1, 1.1.1.2 and 1.1.1.1 to appear is 30:100:50. I wrote a script to get the number of occurrences of each result by executing the same dig command multiple times. The test code example is as follows:

#!/bin/sh

i=0;

rm -f.xtest_tmp.log

while [ $i -lt $1]

do

digwww.chinatesters.cn @lv3ns4.ffdns.net +short >>.xtest_tmp.log

i=`expr $i +1`

done

awk '{name[$1]++};END{for(count in name)printcount,name[count]}' .xtest_tmp.log

The script with the parameter 200 means to execute the command 200 times. After waiting for the execution to complete, the result is as follows:

[root@localhost02_mytest]# ./xtest.sh 200

2.2.2.138

1.1.1.160

1.1.1.2102

We can see that is very close to the configured 30:50:100. After many tests, it will be found that when Local DNS requests CloudXNS more and more times, this value is getting closer and closer to the configuration value. Therefore, when your website has multiple servers but their hardware resources are quite different, you can use AX records to set domain name resolution to different load ratios to make full use of your existing resources for load balancing.

Similarly, the priority settings in the CNAMEX, 301 jump, 302 jump and implicit jump records in CloudXNS have the same effect as the above AX record settings . Users who need it can try it.

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=327002977&siteId=291194637