All Products
Search
Document Center

ApsaraDB RDS:Modify the parameters that specify the maximum number of connections

Last Updated:Mar 01, 2026

When concurrent connections spike or your workload changes, you may need to adjust the connection limits for your ApsaraDB RDS for MySQL instance. Modify max_connections and max_user_connections through the ApsaraDB RDS console or API. Both parameters are dynamic and take effect immediately without a restart.

Parameters

Two MySQL parameters control the maximum number of concurrent connections to an RDS instance:

ParameterScopeRangeError when exceeded
max_connectionsAll database accounts combined1 to 200,000too many connections
max_user_connectionsPer database account10 to 200,000has more than 'max_user_connections' or has exceeded the 'max_user_connections'
Note In this document, "account" refers to MySQL database user accounts, not Alibaba Cloud accounts.

Impact of high connection limits

Connections consume memory. Setting max_connections too high can cause out of memory (OOM) errors and destabilize the instance. To maintain stability, set this parameter to the maximum supported by your instance type.

Behavior: Running Value and open_files_limit

  • Running Value includes O&M reserved connections. After you change max_connections, the Running Value column on the Parameters page shows a number higher than what you specified. The value includes connections reserved for routine O&M. The Maximum Connections field in the Configuration Information section of the Basic Information page reflects the value you specified.

  • open_files_limit can cap max_connections on restart. When the instance restarts, the effective value of max_connections is calculated as: The default value of open_files_limit is 655,350. If you set max_connections above 654,540, also increase open_files_limit in the console to prevent it from capping max_connections after a restart. open_files_limit is a static parameter, so the instance must be restarted for changes to take effect.

      min(open_files_limit - 810, user-defined value or instance type default + O&M reserved connections)

Prerequisites

Before you begin, make sure that you have:

  • An ApsaraDB RDS for MySQL instance

  • The permissions required to modify instance parameters

Modify parameters in the console

  1. Log in to the ApsaraDB RDS console. In the top navigation bar, select the region of your RDS instance. Find the instance and click its ID.

  2. In the left-side navigation pane, click Parameters.

  3. On the Modifiable Parameters tab, find max_user_connections or max_connections. Click the edit icon in the Running Value column, enter the new value, and click OK.

  4. Click Apply Changes. In the dialog box, select when the change takes effect and click OK.

    Note Changes to max_connections and max_user_connections take effect immediately. No restart is required.

Modify parameters by calling an API operation

Call the ModifyParameter operation to change both parameters in a single request.

Sample request

The following example sets max_connections to 2000 and max_user_connections to 500:

http(s)://rds.aliyuncs.com/?Action=ModifyParameter
&DBInstanceId=rm-gs5v9xajylz45****
&Parameters={"max_connections":"2000","max_user_connections":"500"}
&<Common request parameters>

Sample response (JSON)

HTTP/1.1 200 OK
Content-Type:application/json
{
  "RequestId" : "542BB8D6-4268-45CC-A557-B03EFD7AB30A"
}

Verify the change

  1. Log in to the ApsaraDB RDS console. In the top navigation bar, select the region of your RDS instance. Find the instance and click its ID.

  2. In the left-side navigation pane, click Parameters.

  3. Click the Edit History tab and confirm that the new values are listed.

    Edit History tab showing parameter changes

FAQ

Why is the Running Value higher than the instance type default, even though I never changed max_connections?

The Running Value includes connections reserved for routine O&M, so it is always higher than the instance type default. The actual maximum available to your application is shown in the Maximum Connections field on the Basic Information page.

After I changed max_connections, why does the Running Value show a higher number than what I entered?

The Running Value includes O&M reserved connections. Check the Maximum Connections field in the Configuration Information section of the Basic Information page for the value you specified.

I upgraded the instance type, but the maximum number of connections did not change. Why?

Upgrading the instance type does not automatically adjust max_connections. Change the value manually through the console or API. The default connection limits for each instance type are listed in the instance type reference.