Note:
Primary instances, read-only instances, read-only analysis engines, and disaster recovery instances all support parameter modification via the console. The process is essentially the same for each, with only slight differences in how you enter the parameter settings page. The specific differences are described below. This document uses primary instances as an example in the operation steps.
Primary instance: Choose the Instance Management > DMC > Parameter Settings.
Read-only instances, read-only analysis engines, and disaster recovery instances: Choose Instance Management > Parameter Settings.
Use Limits
To ensure instance stability, only some parameters can be modified in the console. These parameters are displayed on the Parameter Settings page.
If the modified parameter requires instance restart to take effect, the system will ask you if you want to restart. We recommend that you do so during off-peak hours and ensure that your application has a reconnection mechanism.
If you want to return to the default formula, clear the entered parameters and apply.
Modifying Parameters in Parameter List
Batch modifying parameters
1. Log in to the TencentDB for MySQL console. In the instance list, click an Instance ID or Manage in the Operation column to access the instance management page. 2. Select Database Management > Parameter Settings and click Parameter Modification.
3. Locate the desired parameters, and modify their values in the Current Value column. After confirming that everything is correct, click Confirm Modification.
4. In the pop-up window, select an option in the Execution Mode and click OK.
Note:
If you select Adjust Now, the parameter modification task will be executed and take effect immediately.
If you select During maintenance time, the parameter modification task will be executed and take effect during this time. For more information, see Setting Instance Maintenance Window. 2. On the Database Management > Parameter Settings tab, locate the desired parameter in the parameter list and click in the Current Value column. 3. Modify the value within the restrictions stated in the Acceptable Values column and click to save the modification. You can click to cancel the operation. 4. In the pop-up window, select an option in the Execution Mode and click OK.
Note:
If you select Adjust Now, the parameter modification task will be executed and take effect immediately.
If you select During maintenance time, the parameter modification task will be executed and take effect during this time. For more information, see Setting Instance Maintenance Window. Modifying Parameters During Parameter Template Import
Scenario 1: Modifying Parameters When Importing a Local Parameter Configuration File
2. Choose Database Management > Parameter Settings and click Import Parameters.
3. In the pop-up window, click Select File to select a .cnf file (no larger than 1 MB) from your local device, and then click Import and Overwrite Original Parameters.
4. After confirming the parameter values, click Confirm Modification.
5. In the pop-up window, select an option in the Execution Mode and click OK.
Note:
If you select Adjust Now, the parameter modification task will be executed and take effect immediately.
If you select During maintenance time, the parameter modification task will be executed and take effect during this time. For more information, see Setting Instance Maintenance Window. Scenario 2: Modifying Parameters Based on the Default Parameter Template
2. Choose Database Management > Parameter Settings and click Default Template.
3. In the pop-up window, select High-Stability Template (Hot) or High-Performance Template as needed, and then click Import and Overwrite Original Parameters.
4. After confirming the parameter values, click Confirm Modification.
5. In the pop-up window, select the execution mode and click OK.
Note:
If you select Adjust Now, the parameter modification task will be executed and take effect immediately.
If you select During maintenance time, the parameter modification task will be executed and take effect during this time. For more information, see Setting Instance Maintenance Window. Scenario 3: Modifying Parameters Based on a Custom Parameter Template
1. Choose Database Management > Parameter Settings and click Custom Template.
2. In the pop-up window, locate and select the custom template you created, and then click Import and Overwrite Original Parameters.
Note:
Only parameter templates with the same database version as the current instance can be selected.
3. After confirming the parameter values, click Confirm Modification.
4. In the pop-up dialog box, select the execution method for the parameter modification task, and then click OK.
Note:
If you select Adjust Now, the parameter modification task for the selected instance will be executed and take effect immediately.
If you select During Maintenance Window, the parameter modification task for the selected instance will be executed and take effect during the maintenance window of the instance. You can use a formula to set the instance parameters. To do so, set the parameters related to the instance specification as a formula, and when the instance specification is changed, the parameter values in the formula will be dynamically changed accordingly and still take effect after the specification change. In this way, the instance is always in the optimal state for running business smoothly.
Taking the {DBinitMemory\\*786432} value of the parameter innodb_buffer_pool_size as an example, when the DBinitMemory in the instance specification is changed, the parameter configuration here doesn't need to be modified, and the value of innodb_buffer_pool_size will be changed automatically.
Expression syntax is supported as follows:
|
| DBinitMemory: The memory size of the instance specification, which is measured in megabytes (MB) and is an integer value. For instance, if the memory size of the instance specification is 1,000 MB, then the value of DBinitMemory is 1024. DBInitCpu: The number of CPU cores in the instance specification, which is an integer value. For example, if the instance specification includes 8 cores, then the value of DBInitCpu is 8. | {DBinitMemory * 786432} = memory size (DBinitMemory) * percentage (75% by default) * 1024 * 1024 (unit conversion) |
| Formula syntax: It should be enclosed in braces ({}). Division operator (/): It divides the dividend by the divisor and returns an integer quotient. If the calculation result is a decimal number, only the integer part will be retained. Decimal numbers are not supported; for example, {MIN(DBInitMemory/4+500,1000000)} instead of {MIN(DBInitMemory0.25+500,1000000)} is supported. Multiplication operator (*): It multiplies two numbers and returns an integer product. If the calculation result is a decimal number, only the integer part will be retained. Decimal number calculation is not supported. | |
| MAX(): It returns the greatest value in an integer or parameter formula list. MIN(): It returns the smallest value in an integer or parameter formula list. | |
Note:
TencentDB for MySQL continuously optimizes parameter settings. The following lists only certain parameters that support parameter formula. You can learn more about parameter formulas in the parameter template in the console.
|
| The number of thread groups in the thread pool. The default value means that the number of thread groups is the same as the number of CPU cores. | |
table_open_cache_instances | The number of partitions where MySQL caches table handles. | {MIN(DBInitMemory/1000,16)} |
| The size of the table descriptor, which can reduce the file open/close times. | {MAX(DBInitMemory*512/1000,2048)} |
| The number of opened table cache instances. | {MAX(DBInitMemory*512/1000,2048)} |
| | {MIN(DBInitMemory/4+500,100000)} |
| The minimum size of the buffer used for normal index scans, range index scans, and table joins that perform full-table scans. | {MIN(DBInitMemory*128,262144)} |
| The number of I/O threads in InnoDB used for write operations. | |
| The number of I/O threads in InnoDB used for read operations. | |
innodb_buffer_pool_instances | The number of partitions in the InnoDB buffer pool. | {MIN(DBInitMemory/2000,16)} |
| The size of the buffer pool in bytes, i.e., the memory zone where InnoDB caches tables and index data. | |
Exporting the Parameter Configuration File to a Local Path
2. Select Database Management > Parameter Settings and click Export Parameters.
Saving the Parameter Configuration of the Current Instance as a Parameter Template
2. Select Database Management > Parameter Settings and click Save as Template.
Synchronizing Changes to Read-only or Disaster Recovery Instance
When modifying parameters and selecting the execution method, you can enable synchronization to apply the changes to read-only or disaster recovery instances if needed.
Canceling Parameter Modification Task
If a parameter modification task (to be executed during maintenance window) has been submitted but you want to cancel it, you can select Task List on the left sidebar in the console, locate the task, and click Cancel in the Operation column. You can cancel a task only before it is executed. The task status should be Waiting for execution. Viewing Parameter Modification Log
2. On the Database Management > Parameter Settings tab, click Recent Modifications on the right.
3. You can view the recent parameter modification records here.
Subsequent Operations