This topic describes how to configure the innodb_buffer_pool_size parameter of an ApsaraDB RDS for MySQL instance based on your business requirements to improve the performance of the instance.

Prerequisites

The RDS instance runs one of the following RDS editions:
  • High-availability Edition
  • Basic Edition
  • Cluster Edition

Limits

You cannot modify the value of the innodb_buffer_pool_size parameter for a serverless RDS instance. The size of the InnoDB buffer pool varies based on the specifications of the serverless RDS instance.

Background information

You can reconfigure the innodb_buffer_pool_size parameter to change the size of the InnoDB buffer pool for an RDS instance. The value of this parameter is calculated by using the following formula:

{DBInstanceClassMemory*X/Y}    

Example:

{DBInstanceClassMemory*7/10}
Note
  • DBInstanceClassMemory is a system variable, which specifies the memory capacity of the RDS instance.
  • X is the numerator, and Y is the denominator.
  • The size of the InnoDB buffer pool must be within the following range: [128 MB, DBInstanceClassMemory × 8/10]. The minimum size is 128 MB. The maximum size is 80% of the memory capacity that you purchased for the RDS instance.

The default size of the InnoDB buffer pool for an RDS instance is calculated based on the following rules:

  • If the RDS instance is a general-purpose instance that uses standard SSDs or enhanced SSDs (ESSDs) or the RDS instance uses local SSDs, the default size of the InnoDB buffer pool is calculated by using the following formula: Default size of the InnoDB buffer pool = Purchased memory capacity of the RDS instance × 0.75.
  • If the RDS instance is a dedicated instance that uses standard SSDs or ESSDs, the default size of the InnoDB buffer pool is calculated by using the following formula: Default size of the InnoDB buffer pool = (Purchased memory capacity of the RDS instance - Reserved memory capacity of the RDS instance) × 0.75.
    Note
    • If the RDS instance is a dedicated instance that uses standard SSDs or ESSDs, the reserved memory capacity in MB of the RDS instance is calculated by using the following formula:
      MIN(Purchased memory capacity of the RDS instance/2, 2048) + MAX(Number of CPU cores of the RDS instance × 64, Purchased memory capacity of the RDS instance/64) + (Purchased memory capacity of the RDS instance/64) + 285
    • The default size of the InnoDB buffer pool is an integer multiple of 128. If the calculated result is not an integer multiple of 128, the result is rounded to the nearest integer that is a multiple of 128. For example, an RDS instance provides 1,024 MB of memory, the calculated result is 268, and the nearest integer that is a multiple of 128 is 256. In this case, the default size of the InnoDB buffer pool for the RDS instance is 256 MB.

The following table provides the default size and maximum size of the InnoDB buffer pool for a dedicated RDS instance that uses standard SSDs or ESSDs.

Number of CPU coresMemory capacity (Unit: MB)Default buffer pool size (Unit: MB)Maximum buffer pool size (Unit: MB)
24,0961,0241,024
28,1924,0964,096
216,3849,21610,240
48,1924,0964,096
416,3849,21610,240
432,76821,50422,528
816,3849,21610,240
832,76821,50422,528
865,53645,05648,128
1224,57615,36016,384
1249,15233,79235,840
1298,30469,63273,728
1632,76821,50422,528
1665,53645,05648,128
16131,07293,18499,328
2449,15232,76834,816
2498,30469,63273,728
24196,608140,288149,504
3265,53645,05647,104
32131,07293,18499,328
32262,144188,416200,704
5298,30467,58472,704
52196,608140,288149,504
52393,216283,648302,080
64262,144188,416200,704
64524,288378,880403,456
102786,432569,344607,232
104196,608138,240147,456
104393,216282,624302,080

The size of the InnoDB buffer pool must be an integer multiple of the result that is obtained by using the following formula: Value of the innodb_buffer_pool_chunk_size parameter × Value of the innodb_buffer_pool_instances parameter. If the size of the InnoDB buffer pool is not an integer multiple of the result that you obtain by using the formula, ApsaraDB RDS changes the size to an integer multiple of the result. For example, if the result that you obtain by using the formula is 1 GB and you set the innodb_buffer_pool_size parameter to 1.5 GB, ApsaraDB changes the value of the innodb_buffer_pool_size parameter to 2 GB.

Change the size of the InnoDB buffer pool for a single RDS instance

Warning After you change the value of the innodb_buffer_pool_size parameter for an RDS instance, the instance restarts. Proceed with caution.
  1. Access RDS Instances, select a region at the top, and then click the ID of the target RDS instance.
  2. In the left-side navigation pane, click Parameters.
  3. Find the innodb_buffer_pool_size parameter and click the Modify icon. In the dialog box that appears, enter a new value and click OK.
    Reconfigure parameters
  4. Click Apply Changes above the parameter list. In the message that appears, click OK. Then, wait for the RDS instance to restart.
    Apply Changes

Change the size of the InnoDB buffer pool for multiple RDS instances at a time

You can create a parameter template that contains the innodb_buffer_pool_size parameter. Then, you can apply the template to multiple RDS instances to change the size of the InnoDB buffer pool for these RDS instances at a time. If a parameter template that contains this parameter has been created, you need to only change the value of this parameter in the template. Then, you can apply the template to multiple RDS instances at a time. For more information, see Use a parameter template to configure the parameters of ApsaraDB RDS for MySQL instances.

Edit parameters by using a parameter template