tencent cloud

All product documents
TDSQL-C for MySQL
Parameter Formula
Last updated: 2023-12-13 10:18:41
Parameter Formula
Last updated: 2023-12-13 10:18:41
TDSQL-C for MySQL now allows certain parameters to use formulaic values for smarter database adaptation. When the instance specifications are adjusted, such parameter values will also be automatically adjusted accordingly, ensuring optimal status or stability of the database.

Notice

The parameter formula is only applicable to parameters with numerical values. Formulaic values are not supported for parameters of other data types.
Upon the setting of formulaic parameter values, these values will change in accordance with the instance specification adjustment. If the calculated parameter value resulting from your formula exceeds the parameter value range (minimum value to maximum value), the parameter value will be set to the nearest boundary value within this range. That is, if it is smaller than the minimum value, the parameter will adopt the minimum value. If it exceeds the maximum value, the parameter will adopt the maximum value. Example:
A parameter, as calculated by the configured formula, results in a value of 7. However, the specified range for the parameter is 1 to 6. In this case, the final value assigned to the parameter will be 6.
A parameter, as calculated by the configured formula, results in a value of 5. However, the specified range for the parameter is 6 to 10. In this case, the final value assigned to the parameter will be 6.
When export from or import from configuration files is configured, formula-based parameter values are not supported. During export, they will automatically be adjusted to integer values.
To ensure the availability of the database, only a select set of parameters currently accommodates formulaic configurations. For more parameters, see upcoming iterations.

Parameter Formula Description

Parameter Formula Composition
Name
Description
Variable
DBinitMemory
The memory size of the instance specification represented as an integer, in the unit of MB.
DBInitCpu
The number of CPU cores in the instance specification, represented as an integer, in the unit of cores.
Operator
Division operator (/)
Divides the dividend by the divisor to return an integer quotient. If the result is a decimal, the integral part is used.
Multiplication operator (*)
The product of two factors is returned as an integer. If the result is a decimal, the integral part is used.
Function
MIN()
Returns the smallest value in the form of an integer or parameter formula list.
MAX()
Returns the greatest value in the form of an integer or parameter formula list.
Example: The MAX(DBInitCpu/2,4) function indicates that the number of CPU cores of the instance divided by 2 is compared with 4 and the larger value is returned.

Parameters Supporting Parameter Formula

The following parameters support parameter formula in the current version. You can modify default formulas according to your business requirements.
Parameter
Description
Default Formula
binlog_cache_size
The size of the memory buffer used to store binary logs of adjustments during the transaction.
MIN(DBInitMemory/4000 * 32768,2097152)
max_heap_table_size
This variable sets the maximum size of user-created tables in the memory.
MIN( DBInitMemory/1000 * 4194304,134217728)
innodb_buffer_pool_size
The size (in bytes) of the buffer pool, which is the memory area of InnoDB cache table and index data.
min((DBInitMemory - 500), DBInitMemory*3/4)*1000000
innodb_buffer_pool_instances
The number of regions divided according to the InnoDB cache pools.
MIN(DBInitMemory/2000,16)
innodb_read_io_threads
The number of I/O threads in InnoDB used for read operations.
MAX(DBInitCpu/2,4)
innodb_write_io_threads
The number of I/O threads in InnoDB used for write operations.
MAX(DBInitCpu/2,4)
join_buffer_size
The minimum size of the cache for table joins used in common index scans, range index scans, and full table scans.
MIN(DBInitMemory*128,262144)
max_connections
The maximum number of connections.
MIN(DBInitMemory/4+500,100000)
table_definition_cache
The number of opened table cache instances.
MAX(DBInitMemory*512/1000,2048)
table_open_cache
The size of table descriptor cache, which can reduce the number of times the files are opened and closed.
MIN(MAX(DBInitMemory*512/1000,2048), 65536)
table_open_cache_instances
The number of partitions for the MySQL table handle cache.
MIN(DBInitMemory/1000,16)
thread_pool_size
This parameter indicates the number of thread groups in the thread pool. By default, the number of thread groups equals the number of CPUs.
MIN(DBInitCpu,64)
thread_cache_size
The number of threads that should be retained in the cache for reuse.
MIN(DBInitMemory/125+8,512)
tmp_table_size
The maximum size of the internal memory temporary table.
MIN(DBInitMemory/1000*4194304,134217728)

Was this page helpful?
You can also Contact Sales or Submit a Ticket for help.
Yes
No

Feedback

Contact Us

Contact our sales team or business advisors to help your business.

Technical Support

Open a ticket if you're looking for further assistance. Our Ticket is 7x24 avaliable.

7x24 Phone Support