Enabling Transaction Splitting for a Proxy Instance
In most cases, a proxy instance sends all requests in transactions to the primary node to ensure transaction correctness. However, in some frameworks, all requests are encapsulated into transactions that are not automatically committed using set autocommit=0. This causes heavy load on the primary node.
With transaction splitting enabled for a proxy instance, the proxy instance can route read requests prior to write operations in a transaction to read replicas, reducing the load on the primary node.
Transaction splitting is disabled by default. After transaction splitting is enabled and autocommit is set to 0, GaussDB(for MySQL) starts a transaction only for write requests. Before the transaction starts, read requests are routed to read replicas through load balancers.
Constraints
- The kernel versions of proxy instances must be 2.3.9.5 or later.
- Transaction isolation levels of GaussDB(for MySQL) instances must be READ UNCOMMITTED or READ COMMITTED. The default isolation level is REPEATABLE READ.
- Proxy instances must be in the read/write mode.
- After transaction splitting is enabled, the transaction isolation level can only be changed to READ UNCOMMITTED or READ COMMITTED. To change the isolation level to a higher level, disable transaction splitting first.
Procedure
- Log in to the management console.
- Click in the upper left corner and select a region and project.
- Click in the upper left corner of the page, choose .
- On the Instances page, click the instance name to go to the Basic Information page.
- In the navigation pane, choose Database Proxy.
- Click the name of a proxy instance.
- On the Basic Information page, click next to Transaction Splitting.
Figure 1 Configuring transaction splitting
- In the displayed dialog box, click Yes.
- To disable transaction splitting, click .
- Transaction splitting takes effect only for new connections established after this function is enabled or disabled.
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