ApsaraDB RDS for MySQL provides the dedicated proxy feature. The dedicated proxy feature provides higher stability, scalability, and performance than the shared proxy feature. If the shared proxy feature is enabled for your primary RDS instance, you can upgrade the database proxy of the instance from a shared proxy to a dedicated proxy.
Upgrade promotions
You are provided a free trial period for the dedicated proxy feature. During the free trial period, you can use the default number of proxy instances that are provided free of charge. If you enable more proxy instances, you are charged for the additional proxy instances that you enable. The free trial period varies based on the billing method:
- If your primary RDS instance uses the pay-as-you-go billing method, the free trial period is one year.
- If your primary RDS instance uses the subscription billing method, the free trial period is at least one year and can vary based on the expiration time of the instance.
- If you perform the upgrade more than one year before your primary RDS instance expires, the free trial period ends at the time when your primary RDS instance expires. Note If you renew your primary RDS instance, the free trial period remains unchanged and does not extend to the new expiration time.
- If you perform the upgrade less than one year before the expiration time of your primary RDS instance, the free trial period is one year.
- If you perform the upgrade more than one year before your primary RDS instance expires, the free trial period ends at the time when your primary RDS instance expires.
- The dedicated proxy of your primary RDS instance provides a default number of proxy instances. If you enable more proxy instances than the default number during the free trial period, you are charged for the additional proxy instances that you enable. For example, if the dedicated proxy provides six default proxy instances, you are not charged when the number of proxy instances that you enable does not exceed 6. However, if you enable seven proxy instances, you are charged for one proxy instance.
- If you disable the dedicated proxy feature for your primary RDS instance during the free trial period, the free trial period ends. You are charged for the dedicated proxy if you enable this feature again.
Prerequisites
- Your primary RDS instance and read-only RDS instances run one of the following MySQL versions and RDS editions:
- 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 Engine versions of your primary RDS instance and read-only RDS instances before you perform the upgrade. For more information, see Update the minor engine version of an ApsaraDB RDS for MySQL instance. - The shared proxy feature is enabled for your primary RDS instance. You can log on to the ApsaraDB RDS console and go to the Database Proxy page to check whether the shared proxy feature is enabled for your primary RDS instance.
Pricing
When you perform the upgrade, ApsaraDB RDS recommends a specific number of proxy instances based on the overall specifications of your primary RDS instance and read-only RDS instances. You are charged an hourly fee for the additional proxy instances that you enable. For more information, see Billing rules for the dedicated proxy feature of ApsaraDB RDS for MySQL.
Background information
The read/write splitting feature of ApsaraDB RDS for MySQL is implemented based on the database proxy feature. For some existing RDS instances that run MySQL 5.6 or MySQL 5.7, the read/write splitting feature is implemented based on the shared proxy feature. However, the shared proxy feature cannot ensure service stability. We recommend that you upgrade the database proxies of these RDS instances from shared proxies to dedicated proxies. The dedicated proxy feature has the following advantages over the shared proxy feature:
- The dedicated proxy feature provides better stability and isolation.
- The dedicated proxy feature provides higher performance. If the instance configuration is not a bottleneck, each proxy instance 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.
- The dedicated proxy feature supports scaling. To process more workloads, you can enable more proxy instances.
- The dedicated proxy feature supports performance monitoring. You can adjust the number of proxy instances based on the monitoring data and your business plan. An adjustment takes effect immediately after it is applied.
- A unified proxy endpoint is provided. This eliminates the need to modify the endpoint information on your application and reduces maintenance costs. The proxy endpoint remains valid until you release the proxy instances. For example, you may enable the read/write splitting feature during peak hours, and then release read-only RDS instances and disable the read/write splitting feature during off-peak hours. In these cases, the proxy endpoint remains connected, and you do not need to update the endpoint information on your application.
- A unified 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 feature, see What are database proxies?.
The following section describes how to upgrade the database proxy of your primary RDS instance from a shared proxy to a dedicated proxy.
Precautions
- After you enable the dedicated proxy feature, each connection is replicated to your primary RDS instance 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 connections that are allowed is limited by the lowest connection specifications among these instances.
- If you create or restart a read-only RDS instance after you enable the dedicated proxy, only the requests over new connections are routed to the read-only RDS instance.
- The max_prepared_stmt_count parameter must be set to the same value for your primary RDS instance and read-only RDS instances.
- For more information, see Usage notes for database proxies.
Impacts
During the upgrade, the endpoints of your primary RDS instance and read-only RDS instances encounter a transient connection that lasts 30 seconds. The read/write splitting endpoint is also unavailable for 30 seconds.
Procedure
- Go to the Instances page. In the top navigation bar, select the region in which the RDS instance resides. Then, find the RDS instance and click the ID of the instance.
- In the left-side navigation pane, click Database Proxy.
- Click Upgrade to Dedicated Proxy. Note Wait until the upgrade is complete.