This topic describes how to enable the dedicated proxy feature for an ApsaraDB RDS for MySQL instance. The dedicated proxy of an RDS instance provides advanced features, such as read/write splitting, connection pool, and transaction splitting.

Prerequisites

  • Your RDS instance is a primary instance that runs one of the following MySQL versions and RDS editions:
    • MySQL 8.0 on RDS Enterprise Edition (The minor engine version is 20191204 or later.)
    • MySQL 8.0 on RDS High-availability Edition (The minor engine version is 20190915 or later.)
    • MySQL 5.7 on RDS Enterprise Edition (The minor engine version is 20191128 or later.)
    • MySQL 5.7 on RDS High-availability Edition (The minor engine version is 20190925 or later.)
    • MySQL 5.6 on RDS High-availability Edition (The minor engine version is 20200229 or later.)
    Note To view the minor engine version of your RDS instance, you must log on to the ApsaraDB RDS console and go to the Basic Information page. Then, in the Configuration Information section, check for the Upgrade Kernel Version button. If the button can be found, you can click the button to view and update the minor engine version. If the button cannot be found, you are using the latest minor engine version. For more information, see Update the minor engine version of an ApsaraDB RDS for MySQL instance.
  • Your RDS instance does not reside in Zone C or Zone D of the China (Hangzhou) region.
    Note If your RDS instance resides in these zones, you must migrate the instance to other zones before you enable the dedicated proxy feature. For more information, see Migrate an ApsaraDB RDS for MySQL instance across zones in the same region.

Limits

  • The dedicated proxy does not support compression protocols.
  • The dedicated proxy does not support vSwitch changes.

Procedure

This section describes how to enable the dedicated proxy feature for your RDS instance in the ApsaraDB RDS console. You can also enable the dedicated proxy feature when you create a read-only RDS instance for your RDS instance. For more information, see Create a read-only ApsaraDB RDS for MySQL instance.

  1. Go to the Database Proxy page.
    1. Log on to the RDS management console, click on the left Instances , and then select a region above.
    2. Find your RDS instance and click the ID of the instance. In the left-side navigation pane, click Database Proxy.
  2. On the page that appears, click Enable Proxy. In the dialog box that appears, configure the Network Type and Proxies parameters and click Enable.
    Enable Database Proxy dialog box
    Note
    • After the dedicated proxy feature is enabled, you must configure proxy terminals before you can use features such as read/write splitting. For more information, see Enable the proxy terminal feature for an ApsaraDB RDS for MySQL instance.
    • The default network type of the dedicated proxy varies based on the configuration of your RDS instance. For more information, see Manage the dedicated proxy endpoints of an ApsaraDB RDS for MySQL instance.
    • We recommend that you set the number of proxy instances to one-eighth of the total number of cores that are configured for your RDS instance and its read-only RDS instances. If the result is not an integer, you must round the result up to the nearest integer. Up to 60 proxy instances are supported.

      For example, if your RDS instance has 8 cores and its read-only RDS instances have 4 cores, the recommended number of proxy instances is 2 based on the following calculation: (8 + 4)/8 = 1.5. The result 1.5 is rounded up to 2.

Overview of the Database Proxy page

The Database Proxy page consists of the following tabs:

  • Proxy

    You can perform various operations on the Proxy tab. For example, you can upgrade the dedicated proxy version and create a dedicated proxy endpoint on this tab.

    Proxy tab
    Section Parameter Description
    Proxy Endpoint Status The status of the dedicated proxy.
    Instance ID The ID of your RDS instance.
    Associated Proxy Instances The number of proxy instances that are enabled under the dedicated proxy. You can increase the processing capability of the dedicated proxy by enabling more proxy instances.
    Endpoint Proxy Terminal The name of a proxy terminal. You can create multiple dedicated proxy endpoints for each proxy terminal. For more information, see Use the dedicated proxy endpoints of an ApsaraDB RDS for MySQL instance to implement read/write splitting.
    Endpoint The endpoint that is used to connect to the dedicated proxy. The dedicated proxy provides a default endpoint to which the proxy terminal feature is bound. You can create, modify, or delete a dedicated proxy endpoint. For more information, see Manage the dedicated proxy endpoints of an ApsaraDB RDS for MySQL instance.
    Port The port number that is bound to a dedicated proxy endpoint.
    Note To change a port number, you must find the endpoint to which the port number is bound and click Change on the right. A valid port number ranges from 1000 to 5999.
    Network Type The network type of a dedicated proxy endpoint. You cannot change the network type of a dedicated proxy endpoint.
    Proxy Instance Proxy Type The type of proxy that is enabled. Only the Dedicated Proxy type is supported.
    CPU and Memory The specifications that are provided per proxy instance. Each proxy instance can have only 2 cores and 4 GB of memory.
    Enabled Proxy Instance The number of proxy instances that are enabled on your RDS instance. ApsaraDB RDS can balance the loads among the proxy instances that are enabled. You can enable up to 60 proxy instances for your RDS instance.
    Note We recommend that you set the number of proxy instances to one-eighth of the total number of cores that are configured for your RDS instance and its read-only RDS instances. If the result is not an integer, you must round the result up to the nearest integer.

    For example, if your RDS instance has 8 cores and its read-only RDS instances have 4 cores, the recommended number of proxy instances is 2 based on the following calculation: (8 + 4)/8 = 1.5. The result 1.5 is rounded up to 2.

  • Proxy Terminal (Original Read/Write Splitting)

    ApsaraDB RDS automatically routes read and write requests to the dedicated proxy endpoints that you configure. Then, these endpoints route the read and write requests to your RDS instance and its read-only RDS instances based on the read weights of these instances. For more information, see Enable the proxy terminal feature for an ApsaraDB RDS for MySQL instance.

  • Monitoring Data

    You can view the CPU utilization for the proxy instances that are enabled. The CPU utilization information helps you obtain the loads on the proxy instances and adjust the number of proxy instances based on the monitoring data. For more information, see View the proxy monitoring data of an ApsaraDB RDS for MySQL instance.

Operations

Operation Description
ModifyDBProxy Enables or disables the dedicated proxy feature for an ApsaraDB RDS instance.
DescribeDBProxy Queries details about the dedicated proxy of an ApsaraDB RDS instance.