Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive
Help Center/ Domain Name Service/ FAQs/ Public Zones/ Configuring Weighted Routing

Configuring Weighted Routing

Updated on 2025-02-10 GMT+08:00

Scenarios

A large website is generally deployed on multiple servers. To balance the load of each server, you can use weights to control the proportion of requests to each server.

The DNS service allows you to set weights to record sets to route the requests to different servers based on the specified weights. If the weight of a record set is set to 0, no result will be returned.

When your website has multiple servers and each server has an independent IP address, consider weighted routing to distribute requests to different servers proportionally.

For example, you have a website deployed on three servers. The domain name of your website is example.com, and the IP addresses of the three servers are 192.168.1.1, 192.168.1.2, and 192.168.1.3.

  • If you add an A record set and set its value to the three IP addresses, with no weights set to the IP addresses, requests are randomly routed to an IP address.

    For details, see How Is a Domain Name Resolved When a Record Set Has Multiple Values?

  • You add three A record sets, with each having an IP address as its value.

    In this case, you can set different weights for the three record sets. In this way, requests are routed to each server based on the specified weight.

Weighted routing can better distribute requests and balance server load. You can perform the operations provided in this section to set the weights for record sets of public zones.

Constraints

You can configure weights for up to 20 record sets of the same domain name and line.

Preparations

There are three web servers. Three A record sets are required, with the value of each set to the IP address of a web server. You can set different weights to control the proportion of requests to each server.

Table 1 Weight setting plans

Plan

Domain Name

Record Set Type

Line Type

Value

Weight

Description

1

example.com

A

Default

192.168.1.1

1

Requests are evenly distributed to three servers (the proportion of requests is 1:1:1).

192.168.1.2

1

192.168.1.3

1

2

example.com

A

Default

192.168.1.1

2

Requests are distributed to three servers in a proportion of 2:3:1.

For example, if there are six requests, two are routed to the server whose IP address is 192.168.1.1, three are routed to the server whose IP address is 192.168.1.2, and one is routed to the server whose IP address is 192.168.1.3.

192.168.1.2

3

192.168.1.3

1

Prerequisites

The domain name of the website has been hosted on the DNS service.

Procedure

The following describes how to add three A record sets to domain name example.com, and the weight ratio of the three record sets is 1:1:1.

  1. Go to the Public Zones page.
  2. On the Public Zones page, click the domain name (example.com) of the public zone.

    The Record Sets tab is displayed.

  3. Click Add Record Set.
  4. Configure the parameters as follows:
    • Name: Leave this parameter blank. This is a record set for the domain name, which is example.com.
    • Type: Retain the default setting A – Map domains to IPv4 addresses.
    • Line Type: Select Default.
    • Value: Set it to 192.168.1.1, the IP address of a web server.
    • Weight: Set it to 1.
  5. Click OK.
  6. Repeat 3 to 5 to add the second and third record sets.

    Set the record set value to 192.168.1.2 and 192.168.1.3, respectively.

    Requests will be evenly distributed to the three servers.

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback