Updated on 2026-08-13 GMT+08:00

Changing the Routing Policy of a Proxy Instance

Scenarios

You can configure the routing policy when creating a proxy instance. The default routing policy is weighted. You can also change the routing policy of an existing instance.

Working Principles of the Routing Policy

Proxy instances support weighted, nearby AZ, and load balancing routing policies.

Weighted Routing Policy

Read requests are assigned to nodes based on the weights you specify.

As shown in the figure, when the proxy instance uses weighted routing and selects the primary node and read replicas R1 and R2 with a read weight ratio of 0:1:2, application A's write requests are automatically forwarded to the primary node while read requests are routed to read replicas R1 and R2 at a 1:2 ratio.

Figure 1 Weighted routing

Load Balancing Routing Policy

Read requests are assigned to nodes with fewer active connections. With this policy enabled, you do not need to set weights for nodes.

As shown in the figure, when the proxy instance uses load balancing routing and selects the primary node and read replicas R1 and R2, the proxy instance determines the target node for each read request based on the number of real-time active connections.

When R2 has a high number of active connections and is under heavy load, the proxy instance routes most read requests to the lower-load R1 and the primary node to reduce pressure on R2.

Figure 2 Load balancing routing

Nearby AZ Routing Policy

A proxy node preferentially routes read requests to the database nodes in the same AZ as the proxy node. In this policy, you are advised to deploy the proxy instance and the TaurusDB nodes in the same AZ to reduce the distribution delay.

As shown in the figure, the proxy instance contains two nodes located in different AZs (AZ 1 and AZ 2). Write requests are routed to the primary node (M) and read requests are routed to the nearest nodes based on the AZ of the application (M and R1 in AZ 1; R2 and R3 in AZ 2) to reduce network latency and improve performance. When all proxy nodes are in AZs different from all TaurusDB instance nodes, the routing policy degrades to load-balancing mode.
Figure 3 Nearby AZ routing

Precautions

For details about how to check the kernel version, see How Can I Check the Version of a TaurusDB Instance?

Procedure

  1. Log in to the TaurusDB console.
  2. Click in the upper left corner and select a region.
  3. On the Instances page, click the instance name.
  4. In the navigation pane, choose Database Proxy.
  5. Click the name of a proxy instance.
  6. On the Basic Information page, click Configure under Routing Policy.
  7. In the displayed dialog box, configure required parameters.

    Figure 4 Changing the routing policy of a proxy instance

    Table 1 Parameter description

    Parameter

    Description

    Routing Policy

    • Weighted: Read requests are assigned to nodes based on the weights you specify.
    • Load balancing: Read requests are assigned to nodes with fewer active connections. In the load balancing policy, you do not need to configure the weights of nodes.
    • Nearby AZ

      A proxy node preferentially routes read requests to the database nodes in the same AZ as the proxy node.

    Associate New Nodes

    After this function is enabled, new read replicas will be automatically associated with the current proxy instance.

    If Routing Policy is Weighted, you need to configure read weights for the new nodes. The default weight of a node is 100. Nodes with higher weights process more read requests.

    Database Nodes

    The proxy mode of a proxy instance determines which nodes read requests are assigned to.

    • Read-only mode: All read requests are assigned to the selected, but not to the primary node.
    • Read/write mode: All read requests are assigned to the selected nodes (including the primary node and read replicas) based on the routing policy.

  8. Click OK. The proxy instance status changes to Configure routing policy.
  9. After several minutes, check that the proxy instance status becomes Available and the routing policy is updated.