Configuring Read Replicas
Scenarios
In a centralized instance, a surge in read requests can consume excessive compute resources. This heavy load may interfere with transaction log (Xlog) replay on standby nodes, leading to increased replication lag between primary and standby nodes. If the primary node fails, the accumulated Xlogs may delay failover. To mitigate this, you can add read replicas to offload and distribute read workloads.
You can also delete read replicas or adjust their specifications to better match changing read demands.
Technical Details
The primary node handles both read and write operations, while standby and log nodes synchronize Xlogs from it. When read traffic increases, high compute resource usage can hinder Xlog replay on standby nodes. Adding read replicas helps offload read requests. They synchronize Xlogs from standby nodes, reducing the primary node's workload and maintaining stable Xlog replay.
Precautions
- Read replica–related operations are supported only for centralized instances in either the 1 primary + 2 standby or 1 primary + 1 standby + 1 log deployment model.
- In the 1 primary + 2 standby deployment model, read replica–related operations are supported only for instances running V2.0-2.7 or later.
- In the 1 primary + 1 standby + 1 log deployment model, read replica–related operations are supported only for instances running V2.0-8.218 or later.
For details about how to view the instance version, see Checking the DB Engine Version.
- Instances with the single private IP address policy enabled do not support read replica–related operations.
- After snapshot-based backup is enabled, read replicas cannot be added.
- Adding read replicas temporarily stops backups. Once the replicas are ready, the system re-enables backups and runs a full backup automatically.
Billing
| Billing Mode | Operation | Impact on Fees |
|---|---|---|
| Yearly/Monthly | Adding a read replica | After a read replica is added, you will be billed for the new read replica based on the time remaining in the requested period of your instance. You need to pay for the difference in price based on the remaining period.
Example (The prices below are for reference only. The actual prices are displayed on the console.) Suppose you purchased a one-month, enterprise-edition instance of version V2.0-8.218 in 1 primary + 2 standby deployment on June 5, 2025. At 15:30 on June 15, 2025, you added a dedicated read replica with 4 vCPUs, 16 GB of memory, 160 GB of ultra-high I/O storage, and a monthly price of $659.12 USD. Billing for the read replica started at 00:00 on June 16, 2025. Price difference = Fee of the new read replica × Remaining period The remaining period in the formula is calculated by dividing remaining days in each calendar month by the total days in that month. In this example, the remaining period and price difference are calculated as follows: Remaining period = 15 (Remaining days in June)/30 (Total days in June) + 5 (Remaining days in July)/31 (Total days in July) = 0.66129. Price difference = $659.12 × 0.66129 = $435.87 USD |
| Deleting a read replica | After a read replica is deleted, the system will stop charging you for it in the original subscription period. GaussDB refunds the difference in price based on the remaining period. End time of the remaining period:
Example (The prices below are for reference only. The actual prices are displayed on the console.) Suppose you purchased a one-month, enterprise-edition instance of version V2.0-8.218 in 1 primary + 2 standby deployment on June 5, 2025. At 15:30 on June 15, 2025, you added a dedicated read replica with 4 vCPUs, 16 GB of memory, 160 GB of ultra-high I/O storage, and a monthly price of $659.12 USD. Its effective start time was rounded to 16:00 on June 15, 2025, and you paid an additional fee of $435.87 USD. For details, see the billing method for adding a read replica. At 17:30 on June 20, 2025, you deleted the read replica. The effective end time was rounded to 18:00 on June 20, 2025. Refund amount = Additional fee paid when the read replica was added × Remaining period − Handling fee The remaining period in the formula is the number of unused hours divided by the total number of hours in the original effective period of the read replica. In this example, the remaining period is calculated as follows: Remaining period = [(24 – 18) (Remaining unused hours on June 20, 2025) + 10 (Remaining unused days in June) × 24 + 5 (Remaining unused days in July) × 24]/[(24 – 16) (Total effective hours on June 15, 2025) + 15 (Total effective days in June) × 24 + 5 (Total effective days in July) × 24] = 366/488 = 0.75. The refund amount is therefore calculated as follows: Refund amount = 435.87 × 0.75 – 435.87 × 10% = $283.32 USD. (In this example, the handling fee rate is 10%.) | |
| Pay-per-use | Adding a read replica | Added read replicas are billed by the hour. |
| Deleting a read replica | Deleted read replicas are no longer billed. |
Adding a Read Replica
- Log in to the GaussDB console.
- On the Instances page, click the name of the target instance to go to the Basic Information page.
- In the Configuration area, click Add in the Read Replicas field.
- Select the specifications and parameter template of the read replica, and click Add Read Replica. Figure 3 Adding a read replica
Table 1 Parameter description Parameter
Description
AZ
An AZ is a physical region where resources have independent power supply and networks. AZs are physically isolated but interconnected through an internal network.
Select either one or three AZs.
New Instance Specifications
CPU and memory specifications of the instance. Different instance specifications have different numbers of database connections.
For details, see Instance Specifications.
Read Replica
A maximum of three read replicas can be added to a single instance.
- Click Next, confirm the information, and click Submit.
- Check the result of adding a read replica.
On the Instances page, the instance status is Creating read replicas. After the instance status becomes Available, click the instance name. On the Basic Information page, check the number of read replicas.
Deleting a Read Replica
- Log in to the GaussDB console.
- On the Instances page, click the name of the target instance to go to the Basic Information page.
- In the Configuration area, click Delete in the Read Replicas field.
- Select the read replica to be deleted and click Next.
- Confirm the information and click Submit.
- Check the result of deleting a read replica.
On the Instances page, the instance status is Deleting a read replica. After the instance status becomes Available, click the instance name. On the Basic Information page, check the number of read replicas.
Changing the Specifications of Read Replicas
- Log in to the GaussDB console.
- On the Instances page, click the name of the target instance to go to the Basic Information page.
- In the Configuration area, click Change in the Read Replicas field.
- On the displayed page, select the target read replica and new specifications, and click Next.
- Confirm the specifications and click Submit.
- Check the specification change result.
After the task is submitted, click Go to Instance List. On the Instances page, the instance status is Changing instance specifications. After a few minutes, check the new instance specifications on the Basic Information page.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot