All Products
Search
Document Center

ApsaraDB RDS:Change the size of the InnoDB buffer pool for an ApsaraDB RDS for MySQL instance

Last Updated:Jun 03, 2024

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 RDS instance.

Prerequisites

The RDS instance runs one of the following RDS editions:

  • RDS High-availability Edition

  • RDS Basic Edition

  • RDS 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 cloud disks or the RDS instance uses local disks, 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 cloud disks, 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 cloud disks, 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 cloud disks.

Number of CPU cores

Memory capacity (unit: MB)

Default buffer pool size (unit: MB)

Maximum buffer pool size (Unit: MB)

2

4,096

1,024

1,024

2

8,192

4,096

4,096

2

16,384

9,216

10,240

4

8,192

4,096

4,096

4

16,384

9,216

10,240

4

32,768

21,504

22,528

8

16,384

9,216

10,240

8

32,768

21,504

22,528

8

65,536

45,056

48,128

12

24,576

15,360

16,384

12

49,152

33,792

35,840

12

98,304

69,632

73,728

16

32,768

21,504

22,528

16

65,536

45,056

48,128

16

131,072

93,184

99,328

24

49,152

32,768

34,816

24

98,304

69,632

73,728

24

196,608

140,288

149,504

32

65,536

45,056

47,104

32

131,072

93,184

99,328

32

262,144

188,416

200,704

52

98,304

67,584

72,704

52

196,608

140,288

149,504

52

393,216

283,648

302,080

64

262,144

188,416

200,704

64

524,288

378,880

403,456

102

786,432

569,344

607,232

104

196,608

138,240

147,456

104

393,216

282,624

302,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

  1. 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.
  2. In the left-side navigation pane, click Parameters.

  3. Find the innodb_buffer_pool_size parameter and click the 修改 icon. In the dialog box that appears, enter a new value and click OK.

    修改参数

  4. Click Apply Changes. In the dialog box that appears, click OK.

    Note

    After you modify the innodb_buffer_pool_size parameter of an RDS instance that runs MySQL 5.6, you must wait for the RDS instance to restart. After you modify the innodb_buffer_pool_size parameter of an RDS instance that runs MySQL 5.7 or MySQL 8.0, you do not need to wait for the RDS instance to restart.

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.

参数模板修改