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

Prerequisites

  • Your RDS instance is a primary instance. In addition, your RDS instance 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, you can check for the Upgrade Minor Engine 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 can migrate the instance to other zones before you enable the dedicated proxy. 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 on your RDS instance by using the ApsaraDB RDS console. You can also enable the dedicated proxy 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 ApsaraDB for RDS console. In the left-side navigation pane, click Instances. In the top navigation bar, select the region where your RDS instance resides.
      选择地域
    2. Find your RDS instance and click its ID. In the left-side navigation pane, click Database Proxy.
  2. Click Enable Proxy. In the Enable Database Proxy dialog box, configure the Network Type and Proxies parameters and click Enable.
    Note
    • The default network type varies based on the instance configuration. For more information, see Manage the dedicated proxy endpoints of an ApsaraDB RDS for MySQL instance.
    • We recommend that you specify the number of proxy instances as the rounded-up integer of the total number of CPU cores for your RDS instance and its read-only RDS instances divided by 8. A maximum of 60 proxy instances are supported.

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

    Enable Database Proxy dialog box

Overview of the Database Proxy page

The Database Proxy page includes the following tabs:

  • Proxy

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

    Proxy tab
    Section Parameter Description
    Proxy Endpoint Status The status of the enabled proxy instances.
    Instance ID The ID of your RDS instance.
    Associated Proxy Instances The number of proxy instances that are enabled on your RDS instance. More proxy instances indicate a higher processing capability.
    Endpoint Proxy Terminal The name of the proxy terminal in use. You can create multiple proxy endpoints for each proxy terminal. For more information, see What is read/write splitting?.
    Endpoint The proxy endpoint that is used to connect to the dedicated proxy of your RDS instance. The dedicated proxy provides a default proxy endpoint. The proxy terminal feature is bound to the default proxy endpoint. 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 the proxy endpoint.
    Note To change the port number, you must click Change on the right. The port number ranges from 1000 to 5999.
    Network Type The network type of the proxy endpoint. You cannot change the network type of a 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. Only 2 CPU cores and 4 GB of memory are supported.
    Enabled Proxy Instances The number of proxy instances that are enabled on your RDS instance. ApsaraDB RDS can balance the loads among the enabled proxy instances. A maximum of 60 proxy instances are supported.
    Note We recommend that you specify the number of proxy instances as the rounded-up integer of the total number of CPU cores for your RDS instance and its read-only RDS instances divided by 8.

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

  • Proxy Terminal (Original Read/Write Splitting)

    ApsaraDB RDS automatically routes read and write requests to the configured proxy endpoints. Then, the proxy 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 read/write splitting feature for an ApsaraDB RDS for MySQL instance.

  • Monitoring Data

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

Related operations

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