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 with a minor engine version of 20191204 or later on RDS Enterprise Edition
    • MySQL 8.0 with a minor engine version of 20190915 or later on RDS High-availability Edition
    • MySQL 5.7 with a minor engine version of 20191128 or later on RDS Enterprise Edition
    • MySQL 5.7 with a minor engine version of 20190925 or later on RDS High-availability Edition
    • MySQL 5.6 with a minor engine version of 20200229 or later on RDS High-availability Edition
    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. In the Configuration Information section of the page, you can check for the Upgrade Kernel Version button. If the button is displayed, you can click the button to view and update the minor engine version. If the button is not displayed, 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 your RDS 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. Visit the RDS instance list, select a region above, and click the target instance ID.
  2. In the left-side navigation pane, click Database Proxy.
  3. On the page that appears, click Enable Proxy. In the dialog box that appears, configure the Network Type parameter and the Proxies parameter 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 a proxy endpoint 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 proxy endpoint on this tab.

    Proxy tab
    Section Parameter Description
    Proxy Endpoint Status The status of the dedicated proxy.
    Instance ID The ID of the RDS instance.
    Associated Proxy Instances The number of proxy instances that are associated with 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 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 proxy endpoint to which the proxy terminal feature is bound. You can create, modify, or delete a 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 proxy endpoint.
    Note To change a port number, you must find the proxy 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 proxy endpoint. You cannot change the network type of a proxy endpoint.
    Proxy Instance Proxy Type The type of proxy that is enabled. Only Dedicated Proxy is supported.
    CPU and Memory The specifications that are provided per proxy instance. Each proxy instance can only have 2 cores and 4 GB of memory.
    Enabled Proxy Instance The number of proxy instances that are enabled for 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. 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.

  • Proxy Terminal (Original Read/Write Splitting)

    ApsaraDB RDS automatically routes read and write requests to the 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.

Related operations

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