ApsaraDB RDS for MySQL provides the dedicated proxy service. The dedicated proxy service outperforms the shared proxy service in terms of stability, scalability, and performance. You can upgrade an existing primary RDS instance from shared proxy to dedicated proxy.

Note Alibaba Cloud will stop the updates and maintenance for the shared proxy service of ApsaraDB RDS for MySQL starting from April 1, 2021. Since then, Alibaba Cloud will provide only technical support for the shared proxy service. We recommend that you upgrade your primary RDS instance from shared proxy to dedicated proxy at your earliest opportunity. For more information, see [Notice] End of updates and maintenance for the shared proxy service.

Prerequisites

  • The primary RDS instance and its read-only RDS instances run one of the following MySQL versions and RDS editions:
    Note
    • If the primary RDS instance runs MySQL 5.6 on RDS Enterprise Edition, the instance does not support the upgrade from shared proxy to dedicated proxy.
    • If the error shown in the following figure occurs during the upgrade, you need to upgrade the minor engine versions of the primary and read-only RDS instances. For more information, see Update the minor engine version of an ApsaraDB RDS for MySQL instance.
    Error
  • The shared proxy service is enabled for the primary RDS instance. To check whether the shared proxy service is enabled for the primary RDS instance, you can log on to the ApsaraDB RDS console and go to the Database Proxy page.

Background information

The read/write splitting feature of ApsaraDB RDS for MySQL is implemented based on database proxies. For some existing RDS instances that run MySQL 5.6 or 5.7, the read/write splitting feature is implemented based on shared proxies. However, the sharing of database proxies may decrease stability. We recommend that you upgrade these RDS instances from shared proxy to dedicated proxy. Dedicated proxies have the following advantages over shared proxies:

  • Dedicated proxies provide better stability and isolation.
  • Dedicated proxies provide higher performance. If the instance configuration is high enough, each dedicated proxy can process up to 20,000 queries per second (QPS) in online transaction processing (OLTP) scenarios. This is verified by a test that is performed by using SysBench.
  • Dedicated proxies support scaling. You can increase the number of dedicated proxies based on your business requirements to handle more workloads.
  • Dedicated proxies support performance monitoring. You can adjust the number of dedicated proxies based on the monitoring data and your business plan. Each adjustment immediately takes effect after it is applied.
  • A unified dedicated proxy endpoint is provided. This reduces maintenance costs by relieving the need to modify the endpoint configuration on your application. In addition, the dedicated proxy endpoint remains valid unless you release the dedicated proxies. For example, you may enable the read/write splitting feature during peak hours, but then release the read-only RDS instances and disable the feature after peak hours. In these cases, you do not need to update the endpoint configuration on your application because the dedicated proxy endpoint remains connected.
  • A unified dedicated proxy endpoint is used to implement features such as read/write splitting, short-lived connection optimization, and transaction splitting.

For more information about the dedicated proxy service, see What are dedicated proxies.

This topic describes how to upgrade an existing primary RDS instance from shared proxy to dedicated proxy.

Billing

When you perform the upgrade, ApsaraDB RDS recommends a specific number of dedicated proxies based on the combined specifications of the primary and read-only RDS instances. Alibaba Cloud offers a discount that allows you to use a specific number of dedicated proxies free of charge. If you want to enable more dedicated proxies, you must pay an hourly rate for these additional dedicated proxies. For more information, see Billing rules for dedicated proxy instances.

Note The discount ends on March 31, 2021.
  • If the primary RDS instance uses the pay-as-you-go billing method:

    You must pay for all the dedicated proxies that are enabled.

    For example, if ApsaraDB RDS recommends six dedicated proxies, you must pay for six dedicated proxies.

  • If the primary RDS instance uses the subscription billing method:
    • Before the primary RDS instance expires, all the dedicated proxies that are recommended by ApsaraDB RDS are free of charge. After the primary RDS instance expires, you must pay for all the dedicated proxies that are enabled.

      In this example, the primary RDS instance is expected to expire on March 30, 2021, and you upgrade the instance from shared proxy to dedicated proxy on March 1, 2021. If ApsaraDB RDS recommends six dedicated proxies, the six dedicated proxies are free of charge from March 1, 2021 to March 30, 2021.

      Note The expiration date that is specified before the upgrade remains valid. This applies even if you renew the primary RDS instance after the upgrade.
    • If you adjust the number of dedicated proxies before the primary RDS instance expires, you need to pay only for the additional dedicated proxies that are beyond the recommended number.

      In this example, the primary RDS instance is expected to expire on March 30, 2021, and you upgrade the instance from shared proxy to dedicated proxy on March 1, 2021. Assume that ApsaraDB RDS recommends six dedicated proxies. If you adjust the number of dedicated proxies to 5 and then from 5 to 6 before March 30, 2021, you do not need to pay additional fees. If you adjust the number of dedicated proxies to 8 before March 30, 2021, you must pay for two dedicated proxies.

    • If you disable the dedicated proxy service and then enable it again before the primary RDS instance expires, you must pay for all the dedicated proxies that are enabled.

      In this example, the primary RDS instance is expected to expire on March 30, 2021, and you upgrade the instance from shared proxy to dedicated proxy on March 1, 2021. Assume that you disable the dedicated proxy service on March 15, 2021 and then enable it again on March 20, 2021. In this case, ApsaraDB RDS recommends eight dedicated proxies, and you must pay for eight dedicated proxies starting from March 20, 2021.

Precautions

  • After you enable the dedicated proxy service, each connection is replicated to the primary and read-only RDS instances in compliance with the 1:N connection model. We recommend that you specify the same connection specifications for these instances. If these instances have different connection specifications, the number of allowed connections is based on the lowest connection specifications among these instances.
  • If you create a read-only RDS instance after you enable the dedicated proxy service, only the requests over new connections are routed to the new read-only RDS instance. This also applies if you restart a read-only RDS instance.
  • The max_prepared_stmt_count parameter must be set to the same value for the primary and read-only RDS instances.
  • For more information, see Usage notes for dedicated proxies.

Impact

During the upgrade, the endpoints of the primary and read-only RDS instances will encounter a 30-second transient connection error. In addition, the read/write splitting endpoint will be unavailable for 30 seconds.

Procedure

  1. Open the Database Proxy page.
    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.
  2. Click Upgrade to Dedicated Proxy.
    Note Wait until the upgrade is completed.