All Products
Search
Document Center

PolarDB:FAQ about PolarProxy

Last Updated:Mar 18, 2024

This topic provides answers to frequently asked questions (FAQ) about PolarProxy provided by PolarDB.

Why am I unable to retrieve a record immediately after I insert the record?

In a read/write splitting architecture, a replication latency may occur during data replication between the primary node and read-only nodes. However, PolarDB supports session consistency. This allows you to query the updates within a session. Therefore, you can retrieve the inserted record after the replication is completed. For more information, see Session consistency.

Can data be read immediately after it is written into PolarDB?

No, data cannot be read immediately after the data is written into PolarDB. A delay of a few milliseconds occurs when you read data by using an endpoint for which read/write splitting is enabled, even if the loads on the primary node and read-only nodes of an PolarDB cluster are not heavy. To eliminate this delay, you can use the primary endpoint to connect to the PolarDB cluster. This way, read and write requests are sent to the primary node. For information about how to query the primary endpoint, see View the endpoint and port number.

Why are the workloads on the primary node high?

High CPU utilization on the primary node can be caused by many reasons. See the following troubleshoot methods:

  • If your business directly accesses the primary endpoint, check whether the business is configured to use the primary endpoint.

  • The number of update requests of your business is much higher than the number of read requests of your business. This causes high workloads on the primary node.

  • If Primary Node Accepts Read Requests of PolarProxy is set to Yes, you can change Primary Node Accept Reads to No to reduce the number of read requests that are routed to the primary node.

  • Check whether Transaction Splitting is enabled for the proxy endpoint. Some ORMs encapsulate all requests in a transaction by default. This routes all requests to the primary node. You can enable Transaction Splitting to reduce the number of read requests prior to write operations that are routed to the primary node.

For stress testing that uses Sysbench, add --oltp-skip-trx=on to your code if Sysbench 0.5 is used or --skip-trx=on if Sysbench 1.0 is used. This way, you do not need to execute the BEGIN and COMMIT statements. For more information about load balancing policies and transaction splitting, see Load balancing.

Why does a node receive more requests than others?

Requests are distributed to each node based on loads. The nodes on which lighter loads exist receive more requests.

Does a new read-only node automatically receive read requests?

Yes.

What are the differences between PolarProxy Standard Enterprise Edition and PolarProxy Dedicated Enterprise Edition?

  • Standard Enterprise Edition is used by clusters of the General-purpose type of PolarDB for MySQL Cluster Edition, which shares CPU resources with smart elastic scaling within seconds provided based on business loads.

  • Dedicated Enterprise Edition is used by clusters of the Dedicated type of PolarDB for MySQL Cluster Edition, which exclusively uses allocated CPU resources and provides better stability.

Is my business affected when I remove a selected read-only node from my cluster?

  • For a cluster endpoint in read and write mode, if the read-only node to be removed has requests, transactions, or temporary tables that are being processed, the cluster endpoint is immediately disconnected. Otherwise, the business is not affected.

  • If the cluster endpoint is in read-only mode, the cluster endpoint is immediately disconnected.

For more information about the impact of removing a read-only node, see Persistent connections.