Relational Database ServiceRelational Database Service

Compute
Elastic Cloud Server
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
Domain Name Service
VPC Endpoint
Cloud Connect
Enterprise Switch
Security & Compliance
Anti-DDoS
Web Application Firewall
Host Security Service
Data Encryption Workshop
Database Security Service
Advanced Anti-DDoS
Data Security Center
Container Guard Service
Situation Awareness
Managed Threat Detection
Compass
Cloud Certificate Manager
Anti-DDoS Service
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GaussDB NoSQL
GaussDB(for MySQL)
Distributed Database Middleware
GaussDB(for openGauss)
Developer Services
ServiceStage
Distributed Cache Service
Simple Message Notification
Application Performance Management
Application Operations Management
Blockchain Service
API Gateway
Cloud Performance Test Service
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
DevCloud
ProjectMan
CodeHub
CloudRelease
CloudPipeline
CloudBuild
CloudDeploy
Cloud Communications
Message & SMS
Cloud Ecosystem
Marketplace
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP License Service
Support Plans
Customer Operation Capabilities
Partner Support Plans
Professional Services
enterprise-collaboration
Meeting
IoT
IoT
Intelligent EdgeFabric
DeveloperTools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Updated at: Apr 02, 2022 GMT+08:00

Rules for Distributing Weights

This section describes the rules of distributing read weights to DB instances of different specifications.

Weight Distribution Rules

When the system automatically sets the read weights for DB instances, the weight values are fixed, as shown in the following table.

The default weight equals to the number of vCPUs multiplied by 50. The weight ranges from 100 to 1000.

For example:
  • If the number of vCPUs is 1, the weight is 100 (1 x 50 = 50, rounded up to the minimum value within the range).
  • If the number of vCPUs is 8, the weight is 400 (8 x 50 = 400).
  • If the number of vCPUs is 32, the weight is 1000 (32 x 50 = 1600, rounded down to the maximum value within the range).
Table 1 Weight distributed to read replicas

vCPUs

Memory (GB)

Weight

1

2

100

1

4

100

1

8

100

2

4

100

2

8

100

2

16

100

4

8

200

4

16

200

4

32

200

8

16

400

8

32

400

8

64

400

16

32

800

16

64

800

16

128

800

32

64

1,000

32

128

1,000

32

256

1,000

60

128

1,000

60

256

1,000

60

512

1,000

Specifying Whether a SQL Statement Is Sent to the Primary DB Instance or Read Replica By Adding a Hint

Hints supported by RDS read/write splitting are as follows:

/*FORCE_MASTER*/: A SQL statement is executed on the primary DB instance.

/*FORCE_SLAVE*/: A SQL statement is executed on a read replica.

  • In addition to the weight distribution system of read/write splitting, hints are a useful type of SQL syntax that allows you to specify whether a SQL statement is executed on the primary DB instance or on a read replica.
  • Hints are only used as routing suggestions. In non-read-only SQL and non-transaction scenarios, SQL statements cannot be routed to read replicas.

Did you find this page helpful?

Failed to submit the feedback. Please try again later.

Which of the following issues have you encountered?







Please complete at least one feedback item.

Content most length 200 character

Content is empty.

OK Cancel