Expression parameters

更新时间:
复制 MD 格式

This topic describes how to use expressions as parameter values for an ApsaraDB RDS for MySQL instance.

Parameter configuration

You can use dynamic expressions to configure instance parameters. When you change the instance type, the system automatically recalculates parameters that are defined as expressions. This ensures parameter settings remain optimized for the new specifications without manual changes.

For example, if you configure innodb_buffer_pool_size with the expression {DBInstanceClassMemory*3/4}, the buffer pool size is automatically set to three-quarters of the instance memory. Consequently, after you change the instance type, the value of innodb_buffer_pool_size adapts to the new specifications to maintain optimal performance.

Expression syntax

Category

Description

Example

Variable

  • AllocatedStorage: The storage capacity of the instance type. Integer.

  • DBInstanceClassMemory: The total memory of the instance type, minus the memory reserved for its control processes. Integer. For example, if an instance type has 16 GB of memory and its control processes occupy 4 GB of memory, the value of DBInstanceClassMemory is 12 GB.

  • DBInstanceClassCPU: The number of CPU cores of the instance type. Integer.

  • DBInstanceClassConnections: The maximum number of connections of the instance type. Integer.

Note
  • For a list of instance types and their corresponding storage capacity, memory, number of CPU cores, and maximum number of connections, see Primary instance types.

  • The memory reserved for control processes is the lesser of the following two values: instance type memory*0.65 and ((instance type memory/16384 MB)+1)*2048 MB.

{DBInstanceClassMemory*3/4}

Operator

  • Expression syntax: Enclose the expression in braces ({}).

  • Division operator (/): Divides the dividend by the divisor and returns an integer quotient. The result is truncated to an integer, not rounded. The operands must be integers.

  • Multiplication operator (*): Multiplies two operands and returns an integer product. The result is truncated to an integer, not rounded. The operands must be integers.

Function

  • The GREATEST() function: Returns the largest value from a list of integers or parameter formulas.

  • The LEAST() function: Returns the smallest value from a list of integers or parameter formulas.

  • The SUM() function: Returns the sum of a list of integers or parameter formulas.

LEAST({DBInstanceClassMemory/256},10485760)