After you enable the read/write splitting feature for an ApsaraDB RDS for SQL Server instance, you can modify the read weight of the RDS instance based on your business requirements.
Prerequisites
- Your RDS instance is a primary RDS instance and meets the following requirements:
- The RDS instance runs SQL Server 2017 on RDS Cluster Edition or SQL Server 2019 on RDS Cluster Edition.
- The RDS instance runs RDS Cluster Edition.
- The RDS instance uses the enhanced SSD (ESSD) storage type.
Note You can go to the Basic Information page of the RDS instance to view the preceding information. - The read/write splitting endpoint is enabled for the RDS instance. For more information, see Enable the read/write splitting endpoint for an ApsaraDB RDS for SQL Server instance.
Procedure
- Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
- In the left-side navigation pane, click Cluster Management.
- Click Configure Readonly Splitting Address
. In the dialog box that appears, select Customized Distribution and configure read weights.
A higher read weight indicates more read requests to process. For example, if the primary RDS instance has three read-only RDS instances whose read weights are 100, 200, and 200, the read-only RDS instances process read requests at a ratio of 1:2:2.
- Automatic Distribution: The system automatically assigns a read weight to each RDS instance in your database system based on the specifications of the RDS instance. After you create a read-only RDS instance, the system automatically assigns a read weight to the read-only RDS instance and adds the read-only RDS instance to the read/write splitting link. No manual intervention is required. For more information, see Default read weights.
- Customized Distribution: You must manually specify a read weight for each RDS instance in your database system based on your business requirements. Valid values: 0 to 10000. By default, the read weight of a read-only RDS instance is 0. After you create a read-only RDS instance, you must manually specify a read weight for the read-only RDS instance based on your business requirements.
Note If you delete a read-only RDS instance, its read weight is also removed, but the read weights of other RDS instances remain unchanged. - Click OK.