tencent cloud

Feedback

Setting Instance Parameters

Last updated: 2022-04-15 16:11:08

    You can view and modify certain parameters and query the parameter modification logs in TencentDB for MySQL console.

    Notes

    • 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 wish to restart. We recommend 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

    Modifying parameters in batches

    1. Log in to the TencentDB for MySQL console. In the instance list, click an instance ID or Manage in the Operation column to enter the instance management page.
    2. Select Database Management > Parameter Settings and click Batch Modify Parameters.
    3. Locate the target 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 the execution mode and click OK.
      Note:

      • If you select Immediate execution, 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 the instance maintenance time.

    Modifying one parameter

    1. Log in to the TencentDB for MySQL console, click an instance ID in the instance list, and enter the instance management page.
    2. On the Database Management > Parameter Settings tab, locate the target 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 the execution mode and click OK.
      Note:

      • If you select Immediate execution, 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 the instance maintenance time.

    Modifying Parameters by Importing Parameter Template

    Option 1. Importing a parameter template on the "Parameter Settings" page

    1. Log in to the TencentDB for MySQL console, click an instance ID in the instance list, and enter the instance management page.
    2. Select Database Management > Parameter Settings and click Custom Template. (If you haven't configured a commonly used custom template yet, you can select Custom Template on the left sidebar in the TencentDB for MySQL console, click Create Template to configure a parameter template, and then import it from the custom template as described in step 2.)
    3. In the pop-up window, select a parameter template and click Import and Overwrite Original Parameters.
    4. After confirming that everything is correct, click Confirm Modification.
    5. In the pop-up window, select the execution mode and click OK.
      Note:

      • If you select Immediate execution, 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 the instance maintenance time.

    Option 2. Modifying parameters by importing a parameter configuration file

    1. Log in to the TencentDB for MySQL console, click an instance ID in the instance list, and enter the instance management page.
    2. Select Database Management > Parameter Settings and click Import Parameters.
    3. Click Select File to locate the target parameter file and click Import and Overwrite Original Parameters.
    4. After confirming that everything is correct, click Confirm Modification.
    5. In the pop-up window, select the execution mode and click OK.
      Note:

      • If you select Immediate execution, 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 the instance maintenance time.

    Option 3. Importing a parameter template on the "Parameter Template" page

    For more information, see Managing Parameter Template > Applying Parameter Template to Instance.

    Restoring to Default Template

    1. Log in to the TencentDB for MySQL console, click an instance ID in the instance list, and enter the instance management page.
    2. Select Database Management > Parameter Settings, click Default Template, select High-Stability Template or High-Performance Template, and click Import and Overwrite Original Parameters.
    3. Click Confirm Modification to redirect to the parameter modification confirmation window.
    4. In the pop-up window, select the execution mode, read and indicate your consent to the restart rules, and click OK.
      Note:

      • If you select Immediate execution, 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 the instance maintenance time.

    Parameter Formula

    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:

    Supported Type Description Sample
    Variable DBinitMemory: The memory size of the instance specification, which is an integer. For example, if the memory size of the instance specification is 4,000 MB, the value of DBinitMemory will be 4000. DBInitCpu: The number of CPU cores of the instance specification, which is an integer. For example, if the instance specification has eight CPU cores, the value of DBInitCpu will be 8. {DBinitMemory * 786432}, i.e., DBinitMemory * percentage (75% by default) * 1024 * 1024 (unit conversion)
    Operator 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(DBInitMemory\*0.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. -
    Function MAX() returns the greatest value in an integer or parameter formula list. MIN() returns the smallest value in an integer or parameter formula list. {MAX(DBInitCpu/2,4)}

    Parameters that support parameter formulas

    Parameter Description Default Formula
    thread_pool_size 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. {MIN(DBInitCpu,64)}
    table_open_cache_instances The number of partitions where MySQL caches table handles. {MIN(DBInitMemory/1000,16)}
    table_open_cache The size of the table descriptor, which can reduce the file open/close times. {MAX(DBInitMemory*512/1000,2048)}
    table_definition_cache The number of opened table cache instances. {MAX(DBInitMemory*512/1000,2048)}
    max_connections The maximum number of connections. {MIN(DBInitMemory/4+500,1000000)}
    join_buffer_size 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)}
    innodb_write_io_threads The number of I/O threads in InnoDB used for write operations. {MAX(DBInitCpu/2,4)}
    innodb_read_io_threads The number of I/O threads in InnoDB used for read operations. {MAX(DBInitCpu/2,4)}
    innodb_buffer_pool_instances The number of partitions in the InnoDB buffer pool. {MIN(DBInitMemory/2000,16)}
    innodb_buffer_pool_size The size of the buffer pool in bytes, i.e., the memory zone where InnoDB caches tables and index data. {DBInitMemory*786432}

    Exporting Parameter Configuration as File

    1. Log in to the TencentDB for MySQL console, click an instance ID in the instance list, and enter the instance management page.
    2. Select Database Management > Parameter Settings and click Export Parameters to export the parameter configuration file.

    Exporting Parameter Configuration as Template

    1. Log in to the TencentDB for MySQL console, click an instance ID in the instance list, and enter the instance management page.
    2. Select Database Management > Parameter Settings and click Save as Template to save the existing parameter configuration as a parameter template.

    Customizing Time Window to Apply Parameter Modifications

    Before you confirm the parameter modification, the "Modify Parameters" dialog box will pop up for you to select a custom time window for the modification to take effect.

    Note:

    If you select During maintenance time, the parameter modification task will be executed and take effect during the instance maintenance time.

    Canceling Parameter Modification Task

    If a parameter modification or batch modification task 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 state should be Waiting for execution.

    Viewing Parameter Modification Logs

    1. Log in to the TencentDB for MySQL console, click an instance ID in the instance list, and enter the instance management page.
    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

    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