Database parameter adjustment method and device
By dynamically obtaining the database running status, determining the configuration parameters to be modified, and adjusting them based on preset rules, the problem that database parameter configuration in the existing technology cannot meet complex scenarios, and maximizing the optimization of database performance is achieved.
Patent Information
- Application Number
- CN202210175193.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Priority Date
- 2022-02-18
- Filing Date
- 2022-02-24
- Publication Date
- 2025-04-08
- Estimated Expiration
- 2042-02-24
AI Technical Summary
In the existing technology, the database parameter configuration is relatively fixed, which cannot meet the needs of complex scenarios in the big data era, resulting in the inability to maximize the optimization of database performance.
By obtaining the current running status of the target database, determining the configuration parameters to be modified, and adjusting these parameters based on the preset modification rules until the end iteration condition is met.
It realizes flexible adjustment of database parameters, optimizes database performance to the maximum extent, and avoids performance bottlenecks caused by fixed configuration parameters.
Smart Images

Figure CN114546990B_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present specification relate to the technical field of database parameter configuration, and in particular to a database parameter adjustment method. Background Art
[0002] After more than half a century of development, database management systems (DBMS) have played an important role in people's production and life. Different scenarios have different requirements for database parameter configuration. For example, when reading data from a database, the memory requirements for the DBMS are relatively high, and when writing data to a database, the processor requirements for the DBMS are relatively high.
[0003] In view of the above situation, DBMS needs to preset a large number of configuration parameters. However, with the advent of the big data era, the scenarios are complex and changeable, and fixed configuration parameters can no longer meet actual needs. Therefore, a more flexible parameter adjustment solution is needed. Summary of the invention
[0004] In view of this, the present specification provides a method for adjusting database parameters. One or more embodiments of the present specification also relate to a database parameter adjustment device, a computing device, a computer-readable storage medium and a computer program to solve the technical defects existing in the prior art.
[0005] According to a first aspect of an embodiment of this specification, a method for adjusting database parameters is provided, including:
[0006] Get the current running status of the target database;
[0007] Based on the current running state, determining configuration parameters of the target database to be modified;
[0008] Based on a preset modification rule, modify the configuration parameter to obtain a modified configuration parameter;
[0009] The target database is run according to the modified configuration parameters, and if an iteration termination condition is met, it is determined that the configuration parameters have been adjusted.
[0010] Optionally, when the target database is run for the first time, the step of obtaining the current running status of the target database includes:
[0011] According to the preset initial configuration parameters, the target database is run to obtain the current running status of the target database.
[0012] Optionally, the step of obtaining the current running status of the target database includes:
[0013] The database operation status acquisition interface is called to obtain the operation status information of the target database from the target database.
[0014] Optionally, the current running state includes multiple state types; the step of determining the configuration parameters of the target database to be modified based on the current running state includes:
[0015] For any state type, determine whether the state information under the state type reaches the preset threshold corresponding to the state type;
[0016] If it is reached, the configuration parameters corresponding to the state type are determined as the configuration parameters to be modified.
[0017] Optionally, the step of modifying the configuration parameters based on preset modification rules to obtain modified configuration parameters includes:
[0018] Identifying a parameter type of the configuration parameter;
[0019] If resource class parameters and workload class parameters appear in the configuration parameters at the same time, the resource class parameters are modified to obtain modified configuration parameters.
[0020] Optionally, after the step of identifying the parameter type of the configuration parameter, the method further includes:
[0021] If only resource parameters appear in the configuration parameters, modify the resource parameters to obtain modified configuration parameters;
[0022] or,
[0023] If only workload parameters appear in the configuration parameters, the workload parameters are modified to obtain modified configuration parameters.
[0024] Optionally, if the iteration termination condition is met, the step of determining that the configuration parameter has completed adjustment includes:
[0025] If it is determined that there are no configuration parameters to be modified based on the operation status obtained by running the target database, then it is determined that the configuration parameters have been adjusted;
[0026] or,
[0027] An operation result of running the target database is obtained, and if the operation result reaches a target operation result, it is determined that the configuration parameter has completed adjustment.
[0028] Optionally, if the iteration termination condition is met, the step of determining that the configuration parameter has been adjusted further includes:
[0029] If the iteration termination condition is not met, the process returns to the step of obtaining the current running status of the target database.
[0030] Optionally, the configuration parameters include resource class parameters; the resource class parameters include memory resource parameters; the target database is a relational database;
[0031] The step of determining the configuration parameters of the target database to be modified based on the current running state includes:
[0032] If it is determined based on the current running state that the current memory information reaches a first preset threshold, then determining a memory resource parameter as a configuration parameter of the target database to be modified;
[0033] The step of running the target database according to the modified configuration parameters and determining that the configuration parameters have been adjusted if an iteration termination condition is met includes:
[0034] Memory resources are allocated according to the modified memory resource parameters, and the target database is run under the allocated memory resources. If an iteration termination condition is met, it is determined that the memory resource parameters have been adjusted.
[0035] Optionally, the configuration parameters include resource class parameters; the resource class parameters include processor resource parameters; the target database is an analytical database;
[0036] The step of determining the configuration parameters of the target database to be modified based on the current running state includes:
[0037] If it is determined based on the current running state that the current processor information reaches a second preset threshold, then determining the processor resource parameter as the configuration parameter to be modified in the target database;
[0038] The step of running the target database according to the modified configuration parameters and determining that the configuration parameters have been adjusted if an iteration termination condition is met includes:
[0039] Processor resources are allocated according to the modified processor resource parameters, and the target database is run under the allocated processor resources. If the iteration termination condition is met, it is determined that the processor resource parameters have been adjusted.
[0040] Optionally, the configuration parameters include resource class parameters; the resource class parameters include memory resource parameters and processor resource parameters; the target database is a hybrid database;
[0041] The step of determining the configuration parameters of the target database to be modified based on the current running state includes:
[0042] If it is determined based on the current running state that the current memory information reaches a first preset threshold and the current processor information reaches a second preset threshold, then determining the memory resource parameter and the processor resource parameter as the configuration parameters to be modified of the target database;
[0043] The step of running the target database according to the modified configuration parameters and determining that the configuration parameters have been adjusted if an iteration termination condition is met includes:
[0044] Memory resources and processor resources are allocated according to the modified resource class parameters, and the target database is run under the allocated memory resources and processor resources. If the iteration termination condition is met, it is determined that the resource class parameters have been adjusted.
[0045] Optionally, the configuration parameters further include workload parameters; after determining that the resource parameters have been adjusted, the following further includes:
[0046] If it is determined based on the current running state that the current workload information reaches a third preset threshold, then based on a preset modification rule, modify the workload class parameter to obtain a modified workload class parameter;
[0047] The workload is allocated according to the modified workload class parameters, and the target database is run under the allocated workload. If the iteration termination condition is met, it is determined that the workload class parameters have been adjusted.
[0048] According to a second aspect of an embodiment of this specification, a database parameter adjustment device is provided, including:
[0049] An acquisition module is configured to acquire the current running status of the target database;
[0050] A determination module, configured to determine the configuration parameters of the target database to be modified based on the current running state;
[0051] A modification module is configured to modify the configuration parameters based on a preset modification rule to obtain modified configuration parameters;
[0052] The running module is configured to run the target database according to the modified configuration parameters, and if the end iteration condition is met, it is determined that the configuration parameters have been adjusted.
[0053] According to a third aspect of an embodiment of this specification, a computing device is provided, including:
[0054] Memory and processor;
[0055] The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions:
[0056] Get the current running status of the target database;
[0057] Based on the current running state, determining configuration parameters of the target database to be modified;
[0058] Based on a preset modification rule, modify the configuration parameter to obtain a modified configuration parameter;
[0059] The target database is run according to the modified configuration parameters, and if an iteration termination condition is met, it is determined that the configuration parameters have been adjusted.
[0060] According to a fourth aspect of the embodiments of this specification, a computer-readable storage medium is provided, which stores computer-executable instructions, and when the instructions are executed by a processor, the steps of any one of the database parameter adjustment methods are implemented.
[0061] According to a fifth aspect of the embodiments of this specification, a computer program is provided, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned database parameter adjustment method.
[0062] An embodiment of the present specification implements the steps of first obtaining the current operating state of a target database; then determining the configuration parameters of the target database to be modified based on the current operating state; then modifying the configuration parameters based on pre-established modification rules to obtain modified configuration parameters; finally, running the target database according to the modified configuration parameters, and determining that the configuration parameters have been adjusted if the iteration termination condition is met.
[0063] One embodiment of the present specification is to derive configuration parameters to be modified based on the operating status of the database, and then modify the configuration parameters based on pre-established modification rules, so that the modified configuration parameters have strong interpretability; and, the configuration parameters to be modified are determined based on the operating status of the database without sampling or modeling the configuration parameters, so that when facing the parameter adjustment of a high-dimensional space with a large number of parameters, it will not be restricted by the curse of dimensionality, and finally, iterative adjustment is used to maximize the performance of the target database. BRIEF DESCRIPTION OF THE DRAWINGS
[0064] Figure 1 is a flow chart of a method for adjusting database parameters provided by an embodiment of this specification;
[0065] Figure 2 It is a process flow chart of a method for adjusting database parameters in an OLTP scenario provided by an embodiment of this specification;
[0066] Figure 3It is a process flow chart of a method for adjusting database parameters in an OLAP scenario provided by an embodiment of this specification;
[0067] Figure 4 It is a process flow chart of a method for adjusting database parameters in a HTAP scenario provided by an embodiment of this specification;
[0068] Figure 5 It is an architecture diagram corresponding to a database parameter adjustment method provided by an embodiment of this specification;
[0069] Figure 6 It is a flowchart of a method for obtaining the operation status of a database provided by an embodiment of this specification;
[0070] Figure 7 It is a schematic diagram of the classification of configuration parameters in a database parameter adjustment method provided in one embodiment of this specification;
[0071] Figure 8 It is a structural diagram of a database parameter adjustment device provided by an embodiment of this specification;
[0072] Fig. 9 It is a structural block diagram of a computing device provided by an embodiment of this specification. DETAILED DESCRIPTION
[0073] Many specific details are described in the following description to facilitate a full understanding of this specification. However, this specification can be implemented in many other ways than those described herein, and those skilled in the art can make similar generalizations without violating the connotation of this specification, so this specification is not limited to the specific implementation disclosed below.
[0074] The terms used in one or more embodiments of this specification are only for the purpose of describing specific embodiments, and are not intended to limit one or more embodiments of this specification. The singular forms of "a", "said" and "the" used in one or more embodiments of this specification and the appended claims are also intended to include plural forms, unless the context clearly indicates other meanings. It should also be understood that the term "and / or" used in one or more embodiments of this specification refers to and includes any or all possible combinations of one or more associated listed items.
[0075] It should be understood that although the terms first, second, etc. may be used to describe various information in one or more embodiments of this specification, this information should not be limited to these terms. These terms are only used to distinguish the same type of information from each other. For example, without departing from the scope of one or more embodiments of this specification, the first may also be referred to as the second, and similarly, the second may also be referred to as the first. Depending on the context, the word "if" as used herein may be interpreted as "at the time of" or "when" or "in response to determining".
[0076] First, the terms involved in one or more embodiments of this specification are explained.
[0077] Database: An organized collection of structured information or data (generally stored in a computer system in electronic form), usually controlled by a database management system (DBMS). In reality, data, DBMS, and associated applications are collectively referred to as a database system, usually referred to as a database. Here we use the term database uniformly. Specifically, a database can be a centralized database or a distributed database. Centralized databases include MySQL and PostgreSQL, and distributed databases include HBase, Cassadra, MongoDB, and OceanBase. This description embodiment takes the OceanBase database as an example.
[0078] Parameter adjustment: The process of modifying the configuration parameters of the database according to system resources and workload to greatly improve database performance.
[0079] Curse of dimensionality: When faced with high-dimensional space data, the original algorithm in low-dimensional space becomes ineffective or its time complexity grows exponentially.
[0080] Database processing scenarios: The main application scenarios of databases include online transaction processing (OLTP), online analytical processing (OLAP) and hybrid transaction and analytical processing (HTAP).
[0081] In the prior art, manual parameter adjustment has the following problems:
[0082] First, due to the large number of database parameters, only a few experienced database administrators can master the proper configuration of various parameters, and thus companies need to spend a lot of money to hire experienced database administrators (DBAs).
[0083] Secondly, when a new workload appears, even an experienced database administrator (DBA) will spend a lot of time adjusting configuration parameters to make the database fully perform.
[0084] Thirdly, in real project scenarios, workloads usually change dynamically, and it is difficult to adjust parameters in a timely manner based on workload changes by relying solely on manpower.
[0085] In order to solve the above problems caused by manual parameter adjustment, a parameter adjustment method based on Gaussian process and an end-to-end solution are proposed to automatically adjust the parameters of the database.
[0086] The parameter adjustment methods based on Gaussian process mainly include: target configuration method, tuning method, OtterTune, source-oriented tuning method. The end-to-end solution mainly includes: cloud database tuning method and query-aware database tuning method. They will be introduced one by one below.
[0087] The target configuration method (BestConfig) is an automatic parameter adjustment method based on space search. It first selects the parameters that need to be adjusted; then uses the Latin Hypercube Sampling (LHS) method to sample the parameter space; then selects samples whose performance meets the preset conditions and selects the area within the preset range around the sample as the next search space; finally, it continuously iterates the space and selects the target performance sampling point. If the sampling performance is not good, the initial space is resampled and iteratively searched.
[0088] The tuning method (iTuned) first proposed the use of Gaussian process to fit the corresponding relationship between database configuration parameters and database performance. This method first selects the configuration parameters to be adjusted; then uses the Latin hypercube sampling method to sample and then establish a preliminary Gaussian process model; finally, the maximum expectation improvement method is used to explore and develop the Gaussian process model until a satisfactory result is obtained.
[0089] OtterTune also uses Gaussian processes to adjust configuration parameters; however, OtterTune uses historical configuration parameters of similar workloads and their corresponding database performance data to perform a preliminary fit to the Gaussian process, and OtterTune uses the minimum shrinkage and selection algorithm (Lasso) to obtain parameters that play an important role in the current database performance.
[0090] Resource-oriented tuning (ResTune) also uses Gaussian processes for parameter adjustment, but the biggest feature of this method is that it minimizes the use of system resources while ensuring that the throughput and latency of the DBMS remain roughly unchanged.
[0091] The above-mentioned parameter adjustment method based on Gaussian process is a pipelined working method, that is, the adjustment process is divided into multiple stages and the target solution of each stage is passed to the next stage. However, this working method is difficult to ensure that the target solution of the next stage is obtained through the target solution of each stage, and thus the overall result cannot meet the preset conditions.
[0092] Cloud Database Tune (CDBTune) uses reinforcement learning to adjust database parameters: Deep Deterministic Policy Gradient (DDPG) as the agent; the value of the configuration parameter as the action; the database as the environment; the database's metrics as the state; and the database's throughput and latency changes as the reward.
[0093] Query-aware database tuning (QTune, Query Tune) also uses reinforcement learning methods to perform end-to-end database parameter adjustment. Its biggest feature is multi-granularity parameter adjustment: query-level adjustment, workload-level adjustment, and cluster-level adjustment.
[0094] All the above-mentioned automatic parameter adjustment methods inevitably have the following two shortcomings: 1) Lack of strong interpretability: Whether it is a search-based method or a model-based fitting method, they are all summarized based on the sampled data, and no reasonable causal reasoning process is given for each step in the process. 2) Dimensional curse: In the face of a high-dimensional space with a large number of parameters, the search-based adjustment method and the reinforcement learning-based adjustment method require a lot of adjustment time to obtain satisfactory adjustment results; and the Gaussian process-based adjustment method, its Gaussian process itself will fail in high-dimensional space.
[0095] Therefore, in this specification, a database parameter adjustment method is provided. This specification also relates to a database parameter adjustment device, a computing device, and a computer-readable storage medium, which are described in detail one by one in the following embodiments.
[0096] The database parameter adjustment method provided in the embodiment of this specification may be implemented by a DBMS, or by at least one of software, hardware circuits, and logic circuits set in the implementation subject.
[0097] Figure 1A flowchart of a database parameter adjustment method provided according to an embodiment of the present specification is shown, which specifically includes the following steps.
[0098] Step 102: Obtain the current running status of the target database.
[0099] The target database refers to the database that needs to adjust database parameters.
[0100] The current running status refers to the status of the target database when it is running according to the current configuration parameters. The current running status includes multiple status types, including but not limited to: the internal status of the database, the CPU utilization of the database, and the I / O status of the database disk.
[0101] In practical applications, obtaining the current running status of the target database means running the target database according to the current configuration parameters and obtaining the running status of the target database, so as to provide a reference for subsequently determining which parameters in the target database need to be modified.
[0102] Optionally, step 102 may be specifically implemented by the following steps: running the target database according to preset initial configuration parameters, and obtaining the current running status of the target database.
[0103] In practical applications, database parameter adjustment often needs to be achieved through multiple iterations. Each iteration process can be to run the target database based on the current configuration parameters to obtain the running status and modify the current configuration parameters in this iteration process. The current configuration parameters are often obtained by modifying the database parameters in the previous iteration process. For the first iteration process, there is no previous iteration process. Therefore, in the first iteration process, it is necessary to set the initial configuration parameters for the target database, and run the target database according to the preset initial configuration parameters, so as to obtain the running status of the target database in the first iteration process and complete the first iteration process.
[0104] Generally, the number of configuration parameters of the target database is greater than 200. For example, MySQL has 215 configuration parameters, PostgreSQL has 247 configuration parameters, and OceanBase has thousands of configuration parameters. Accordingly, the database administrator can classify all configuration parameters that may affect database performance into two categories according to their impact on the target database performance: configuration parameters that directly affect the target database performance and configuration parameters that do not directly affect the target database performance.
[0105] In actual applications, the initial configuration parameters can be set manually, such as the DBA pre-setting the initial configuration parameters based on experience.
[0106] The DBA sets the configuration parameters that directly affect the performance of the target database based on experience, and sets the configuration parameters that do not directly affect the performance of the target database by default according to system recommendations.
[0107] According to the initial configuration parameters, the target database is run, and the current running state of the target database is obtained in order to give a configuration parameter so that the target database can run, and then start the iteration process, and continuously adjust the configuration parameters of the target database in the subsequent iteration process.
[0108] Optionally, step 102 may be specifically implemented by the following steps: calling a database running status acquisition interface to obtain the running status of the target database from the target database.
[0109] The database operation status acquisition interface is an encapsulated set of functional commands that can call the operation status of the target database. The database operation status acquisition interface is used to implement direct operations on the target database without the need for underlying source code to operate, such as ActiveX Data Objects (ADO), Database Access Objects (DAO), Open Database Connectivity (ODBC), low-level application program interfaces leading to different data sources (OLEDB, Object Linking and Embedding Database) and Java Database Connectivity (JDBC), etc., which are not limited here. Calling the database operation status acquisition interface speeds up the speed of obtaining the state of the target database at runtime, thereby speeding up the speed of each iteration process.
[0110] When calling the database operation status acquisition interface to obtain the state of the target database at runtime from the target database, the database commands in the database operation status acquisition interface can be used. The database commands are operation commands pre-set on the database interface in the DBMS, including create database commands, delete database commands, refresh database commands, query commands, add data commands, obtain database operation status commands, etc. The commands for obtaining database operation status are commands pre-set on the database operation status acquisition interface, including: DB status commands (db.stats() and db.serverStatus()), sar-u commands, sar-d commands, etc.
[0111] In actual applications, the DB status command is used to obtain the internal status of the target database, the sar-u command is used to obtain the CPU utilization status of the target database, and the sar-d command is used to obtain the I / O status of the disk of the target database.
[0112] The embodiments of this specification provide a data basis for subsequently determining the configuration parameters of the target database to be modified based on the current running status by acquiring the current running status of the target database.
[0113] Step 104: Based on the current running state, determine the configuration parameters of the target database to be modified.
[0114] Specifically, the status information of the current running status may be determined, and then based on the status information, the configuration parameters of the target database to be modified may be determined.
[0115] According to the current running state in step 102, which includes multiple state types, it can be known that the acquired current running state includes the internal state of the database, the CPU utilization of the database, the I / O state of the disk of the database, etc. Correspondingly, the state information of the current running state includes the internal state information of the database, the CPU utilization information of the database, the I / O state information of the disk of the database, etc.
[0116] The configuration parameters to be modified of the target database refer to configuration parameters that can be adjusted. The configuration parameters to be modified can be subsequently adjusted to obtain the modified configuration parameters.
[0117] In actual applications, there may be hundreds of configuration parameters to be modified in the target database. Modifying each parameter and iteratively running the database will make the configuration parameter adjustment process take too long and the adjustment efficiency too low. Therefore, in the general database parameter adjustment process, not every configuration parameter to be modified is adjusted, but the corresponding configuration parameters to be modified are adjusted first according to the database operation requirements, so that the efficiency of database parameter adjustment can be guaranteed while meeting the operation requirements.
[0118] Optionally, step 104 may be specifically implemented by the following steps: for any state type, determining whether the state information under the state type reaches a preset threshold corresponding to the state type; if reached, determining the configuration parameter corresponding to the state type as the configuration parameter to be modified.
[0119] The preset threshold corresponding to the state type refers to a series of pre-set state information data monitoring interval sets for each type of operating state stored in the DBMS. If the monitored operating state information of the target database exceeds the corresponding type of data monitoring interval set, an alarm notification will be issued. The state information data monitoring interval set can be manually set according to the performance of the software and hardware, or obtained based on the test data using statistical methods, which is not limited here.
[0120] Specifically, the current running status of the target database is obtained, including three types of running status: the internal status of the database, the CPU utilization of the database, and the I / O status of the disk of the database. The corresponding database internal status information is {version number Version3.1, data size dataSize: 500, storage size storageSize: 14400, ...}, the database CPU utilization status information is 49.3%, and the disk I / O status information of the database is: 100MB / s; 120MB / s. The corresponding preset thresholds corresponding to the three status types obtained from the DBMS are {Version3.0+, dataSize: 3000, storageSize: 140000, ...}, 45%, 150MB / s; 150MB / s. It is determined that the status information under the CPU utilization status type has reached the preset threshold corresponding to the status type, so as to determine the configuration parameters corresponding to the CPU status type as the configuration parameters to be modified.
[0121] In the embodiment of the specification, the configuration parameters to be modified of the target database are determined based on the current operation state, so that the determined configuration parameters to be modified have strong explanatory power. For the database administrator, it can be known that the determined configuration parameters to be modified are the types of the corresponding operation states, and thus how to adjust the configuration parameters of the target database in order to make the operation state of this type meet the operation conditions and make the target database run smoothly, thereby achieving accurate evaluation of the configuration parameter adjustment process.
[0122] Step 106: Based on the preset modification rule, the configuration parameters are modified to obtain modified configuration parameters.
[0123] The preset modification rule refers to a preset modification rule for a parameter to be modified in the current iteration, such as a preset modification rule for modifying a configuration parameter based on a parameter type of the configuration parameter.
[0124] In actual applications, the parameter type of the configuration parameter to be modified is first identified, and then the configuration parameters of the corresponding type in the configuration parameters to be modified are modified to obtain the modified configuration parameters. That is, the configuration parameters corresponding to the parameter type to be modified can be screened out from the configuration parameters to be modified to obtain the modified configuration parameters.
[0125] Among them, configuration parameters can be divided into resource parameters and workload parameters according to whether they are directly related to the resources that need to be called when the database is running. Resource parameters are configuration parameters of resources (CPU, memory, disk, etc.) that need to be called when the target database is running. Workload parameters are parameters that are not directly related to the resources that need to be called when the database is running, but are directly related to the characteristics of the workload.
[0126] The CPU configuration parameters are database parameters that control how the CPU calls and allocates data, including parameters that control the number of read and write threads, parameters that control how many threads can enter the database kernel at the same time, and the like.
[0127] The memory configuration parameters are related to controlling the database memory size, including: parameters for setting the buffer pool size, parameters for controlling the log cache size, etc.
[0128] The disk configuration parameters are related to controlling the size of various database files, including: setting parameters for the redo log file size and setting parameters for the undo log file size.
[0129] Workload parameters are parameters directly related to the characteristics of the workload, including: whether to enable the pre-reading function, the proportion of the old list in the least recently used algorithm list (LRU) and the proportion of the insert buffer in the buffer pool.
[0130] Optionally, step 106 may be specifically implemented through the following steps: identifying the parameter type of the configuration parameter; if the resource class parameter and the workload class parameter appear in the configuration parameter at the same time, modifying the resource class parameter to obtain the modified configuration parameter.
[0131] If resource parameters and workload parameters appear in the configuration parameters at the same time, the resource parameters are modified. For example, the configuration parameters to be modified include: parameters for controlling the number of read and write threads, parameters for setting the buffer pool size, and parameters for whether to enable the pre-reading function. In the current iteration, only the parameters for controlling the number of read and write threads and the parameters for setting the buffer pool size are modified.
[0132] Optionally, after the step of identifying the parameter type of the configuration parameter, the following steps may also be included:
[0133] If only resource parameters appear in the configuration parameters, modify the resource parameters to obtain the modified configuration parameters;
[0134] or,
[0135] If only workload parameters appear in the configuration parameters, the workload parameters are modified to obtain modified configuration parameters.
[0136] Resource parameters are the parameters that most directly affect the resource allocation of the target database, and the main purpose of database parameter configuration is to achieve full utilization of resources. First modify the resource parameters, run the target database in the subsequent process, and then modify the workload parameters in subsequent iterations according to the running status of the target database. The overall parameter adjustment time is met, the number of parameters to be modified is greatly reduced, and there is no need to restore the initial value in subsequent iterations before modifying it. In this way, the preset modification rules enable the adjustment results to converge quickly and achieve full utilization of resources.
[0137] In one possible implementation, the parameter type of the configuration parameter to be modified is identified. When modifying the configuration parameters of the corresponding type in the configuration parameters to be modified, the configuration parameters corresponding to the parameter type to be modified can be filtered out and sent to the client, and the database administrator can manually make modifications to obtain the modified configuration parameters.
[0138] In another possible implementation, the parameter type of the configuration parameter to be modified is identified, and when the configuration parameter of the corresponding type in the configuration parameter to be modified is modified, the modification can also be automatically performed according to a preset adjustment interval. Specifically, the modified configuration parameter can be determined in the preset adjustment interval based on a pre-trained neural network. Of course, the configuration parameter can also be automatically modified based on other methods, which are not limited here.
[0139] The preset adjustment interval can be pre-set according to configuration parameters of different numerical types. Configuration parameters can be divided into integer type, string type, floating point type, etc. according to their numerical types. The preset adjustment interval is used to limit the adjustment range of the configuration parameters to avoid excessive adjustment of the configuration parameters of the translation model.
[0140] For configuration parameters of integer type and floating-point type, the corresponding adjustment range consists of the following information: {parameter type, minimum value, maximum value, default value}. The minimum value and maximum value are an adjustable range defined by the database administrator based on the machine configuration, project type, and project quantity of the requesting device.
[0141] For string type configuration parameters, the adjustment range consists of the following information: {parameter type, all possible discrete values, default value}. All possible discrete values are an adjustable range defined by the database administrator based on the machine configuration, project type, and project quantity of the requesting device.
[0142] Based on the preset modification rules, the configuration parameters are modified. This further reflects that the configuration parameters that need to be modified are obtained based on reasonable causal inference, which is highly explanatory. In addition, compared with sampling the parameters of the database or modifying them through the modeling process, a large number of parameters obtained inevitably exist in a high-dimensional space. If the modification is made directly, the dimensionality disaster will occur. The embodiment of this specification avoids the problem of dimensionality disaster because the modification is based on the modification rules.
[0143] Step 108: Run the target database according to the modified configuration parameters. If the iteration termination condition is met, it is determined that the configuration parameters have been adjusted.
[0144] The end iteration condition is that in actual application, when the preset end iteration condition is met during the process of repeating the above steps 102 to 106, it is determined that the configuration parameters are adjusted.
[0145] According to the modified configuration parameters, the target database is run. If the end iteration condition is met, it is determined that the configuration parameters have been adjusted. The end iteration condition is statically determined according to the operation requirements of the target database.
[0146] For example, if the target database does not need to be sufficiently accurate but needs to be put into use quickly, that is, the parameter adjustment time is required to be as short as possible, then the end iteration condition can be set to end the iteration process after the preset time is met, and the configuration parameters are determined to be adjusted; if the target database needs to be sufficiently accurate but does not need to be put into use quickly, that is, there is no requirement for parameter adjustment time, then the end iteration condition can be set to end the iteration process after all configuration parameters to be modified are modified, and the configuration parameters are determined to be adjusted; if the target database only needs to meet the configuration parameter adjustment of resources, then the end iteration condition can be set to end the iteration process after all resource-related parameters are adjusted, and the configuration parameters are determined to be adjusted. No limitation is made here.
[0147] Optionally, if the condition for ending the iteration is met in step 108, it is determined that the configuration parameters have been adjusted, which can be specifically achieved through the following steps: if it is determined that there are no configuration parameters to be modified based on the operating status obtained from the operating target database, it is determined that the configuration parameters have been adjusted; or, the operating result of the operating target database is obtained, and if the operating result reaches the target operating result, it is determined that the configuration parameters have been adjusted.
[0148] Specifically, if all types of operating status information data meet the preset threshold, it can be determined that there are no configuration parameters to be modified, and the adjustment of the configuration parameters is determined to be completed; if the end iteration condition is only set for the operating status with actual application requirements, then when the operating status of the target database is obtained to meet the end iteration requirement, it is determined that the configuration parameters are adjusted.
[0149] For example, if the CPU utilization of the target database's operating state is required to be less than 45%, after iterative adjustment, the CPU utilization of the target database's current operating state is 43%, then the iterative process ends and the configuration parameters are determined to complete the adjustment.
[0150] The condition for ending the iteration may also be dynamically determined based on the operating requirements of the target database. Compared with setting a fixed value range, the embodiments of the present specification may dynamically determine and modify configuration parameters based on the operating status, thereby making full use of system resources.
[0151] Optionally, if the iteration termination condition is not met, the process returns to step 102 .
[0152] When the iteration termination condition is not met, returning to step 102 can adjust the parameters through the iteration process to ensure that the adjusted configuration parameters can achieve the target solution under certain conditions, thereby greatly improving the performance of the target database.
[0153] Through an embodiment of the present specification, reasonable causal inference can be made on the process of determining the configuration parameters to be modified and modifying the configuration parameters during the target database parameter adjustment process, which can enable the database administrator to make a reasonable assessment of the credibility of the above process, because no sampling and model methods are used, but the configuration parameters to be modified are determined directly based on the running status and the parameters are modified based on the modification rules, which is not restricted by the curse of dimensionality, and the performance of the target database can be further improved under the constraints of system resources and workload.
[0154] The configuration parameters in step 106 in the above embodiment are divided into resource type parameters and workload type parameters according to whether they are directly related to the resources that need to be called when the database is running. The following provides three corresponding embodiments for adjusting the resource type parameters and workload type parameters in the configuration parameters of the target database in three different scenarios.
[0155] By applying the embodiments of this specification, the configuration parameters to be modified are obtained based on the operating status of the database, and then the configuration parameters are modified based on the pre-established modification rules, so that the modified configuration parameters have strong interpretability; and, the configuration parameters to be modified are determined based on the operating status of the database without sampling or modeling the configuration parameters, so that when facing the adjustment of high-order spatial parameters with a large number of parameters, they will not be restricted by the curse of dimensionality; finally, iterative adjustment is used to maximize the performance of the target database.
[0156] The following combination Figure 2, taking the application of the database parameter adjustment method provided in this specification in the OLTP scenario as an example, where the configuration parameters include resource parameters; resource parameters include memory resource parameters; the target database is a relational database, the database parameter adjustment method is further described. Figure 2 A process flow chart of a method for adjusting database parameters in an OLTP scenario provided by an embodiment of the present specification is shown, which specifically includes the following steps.
[0157] Step 202: Obtain the current running status of the target database, wherein the target database is a relational database.
[0158] Step 204: If it is determined based on the current running state that the current memory information reaches a first preset threshold, the memory resource parameter is determined as a configuration parameter of the target database to be modified.
[0159] Memory information can be Figure 1 The database operation status information in step 104 in the embodiment is the I / O status information of the disk of the database.
[0160] Correspondingly, the memory resource parameters can be Figure 1 The parameters related to controlling the database memory size in step 106 of the embodiment include: parameters for setting the buffer pool size, parameters for controlling the log buffer area size, etc.
[0161] The first preset threshold can be Figure 1 In the embodiment, in step 104, a series of pre-set state information data monitoring interval sets for memory operation status stored in the DBMS are generated. If the monitored memory operation status information data of the relational database exceeds the corresponding monitoring interval, an alarm notification will be issued. The memory status information data monitoring interval can be manually set according to the performance of the software and hardware, or can be obtained based on the test data using statistical methods, which is not limited here.
[0162] Step 206: Based on the preset modification rule, the configuration parameters are modified to obtain modified configuration parameters.
[0163] Step 208: Allocate memory resources according to the modified memory resource parameters, run the target database under the allocated memory resources, and if the end iteration condition is met, determine that the memory resource parameters are adjusted.
[0164] Step 210: If it is determined based on the current running state that the current workload information reaches a third preset threshold, the workload class parameters are modified based on preset modification rules to obtain modified workload class parameters.
[0165] The third preset threshold can be Figure 1In the embodiment, in step 104, a series of pre-set state information data monitoring interval sets for the internal operation state of the database stored in the DBMS are provided. If the monitored internal operation state information data of the relational database exceeds the corresponding monitoring interval, an alarm notification will be issued. The monitoring interval of the internal state information data of the relational database can be manually set according to the performance of the software and hardware, or can be obtained by using statistical methods based on test data, which is not limited here.
[0166] Step 212: Allocate workload according to the modified workload class parameters, run the target database under the allocated workload, and if the iteration termination condition is met, determine that the workload class parameters have been adjusted.
[0167] This embodiment is a database parameter adjustment method in an OLTP scenario. The online transaction processing scenario focuses on inserting, deleting and updating data, while there are relatively few data query operations and the query statements are simple. Therefore, the relational database set for the online transaction processing scenario has a large number of write operations, and the bottleneck of the relational database operation status is mainly the I / O operation of the data. The corresponding resource requirement is the memory resources that the target database can call.
[0168] In one embodiment of the present specification, a reasonable causal inference can be made on the process of determining the configuration parameters to be modified and modifying the configuration parameters during the parameter adjustment process of the target relational database, which can enable the database administrator to make a reasonable assessment of the credibility of the above process, because no sampling and model methods are used, and the memory parameters to be modified are determined directly based on the running status of the relational database and the parameter modifications are made based on the modification rules, which is not restricted by the curse of dimensionality, and the data I / O operation performance of the target relational database can be further improved under the constraints of system resources and workload.
[0169] The following combination Figure 3 , taking the application of the database parameter adjustment method provided in this specification in the OLAP scenario as an example, where the configuration parameters include resource parameters; resource parameters include processor resource parameters; the target database is an analytical database, the database parameter adjustment method is further described. Figure 3 A process flow chart of a method for adjusting database parameters in an OLAP scenario provided by an embodiment of the present specification is shown, which specifically includes the following steps.
[0170] Step 302: Obtain the current operating status of the target database, where the target database is an analytical database.
[0171] Step 304: If it is determined based on the current operating state that the current processor information reaches a second preset threshold, the processor resource parameter is determined as a configuration parameter of the target database to be modified.
[0172] Processor information can be Figure 1 The CPU utilization information of the database in the database operation status information in step 104 of the embodiment.
[0173] Correspondingly, the memory resource parameters can be Figure 1 In the embodiment, the database parameters for controlling how the CPU calls and allocates in step 106 include: parameters for controlling the number of read and write threads, parameters for controlling how many threads can enter the database kernel at the same time, etc.
[0174] The second preset threshold can be Figure 1 In the embodiment, in step 104, a series of pre-set state information data monitoring interval sets for the processor operation state stored in the DBMS are generated. If the monitored processor operation state information data of the analytical database exceeds the corresponding monitoring interval, an alarm notification will be issued. The processor state information data monitoring interval can be manually set according to the performance of the software and hardware, or can be obtained based on the test data using statistical methods, which is not limited here.
[0175] Step 306: Based on the preset modification rule, the configuration parameters are modified to obtain modified configuration parameters.
[0176] Step 308: Allocate processor resources according to the modified processor resource parameters, run the target database under the allocated processor resources, and if the iteration termination condition is met, determine that the processor resource parameters have been adjusted.
[0177] Step 310: If it is determined based on the current running state that the current workload information reaches a third preset threshold, the workload class parameters are modified based on preset modification rules to obtain modified workload class parameters.
[0178] The third preset threshold can be Figure 1 In step 104 of the embodiment, a series of pre-set status information data monitoring interval sets for the internal operation status of the database stored in the DBMS will issue an alarm notification if the monitored database internal operation status information data of the analytical database exceeds the corresponding monitoring interval. The internal status information data monitoring interval of the analytical database can be manually set according to the performance of the software and hardware, or can be obtained based on the test data using statistical methods, which is not limited here.
[0179] Step 312: Allocate workload according to the modified workload class parameters, run the target database under the allocated workload, and if the iteration termination condition is met, determine that the workload class parameters have been adjusted.
[0180] This embodiment is a database parameter adjustment method in an OLAP scenario. The online analytical processing scenario focuses on query operations on data, and the query statement usually contains a large number of aggregation operations, while the insertion, deletion and update operations on data are relatively small. Therefore, the analytical database set for the online analytical processing scenario has a large number of read operations. The bottleneck of the operating status of the analytical database is mainly the reasonable use of the processor, and the corresponding resource requirement is the processor that the target database can call.
[0181] In one embodiment of the present specification, reasonable causal inference can be made on the process of determining the configuration parameters to be modified and modifying the configuration parameters during the parameter adjustment process of the target analytical database, which can enable the database administrator to make a reasonable assessment of the credibility of the above process. Because compared with the method of using sampling and models, the processor parameters to be modified are determined directly based on the running status of the analytical database and the parameters are modified based on the modification rules, which is not restricted by the curse of dimensionality. The performance of the processor resources of the target analytical database can be further improved under the constraints of system resources and workload.
[0182] The following combination Figure 4 Taking the application of the database parameter adjustment method provided in this specification in the HTAP scenario as an example, the configuration parameters include resource parameters; resource parameters include memory resource parameters and processor resource parameters; the target database is a hybrid database, and the database parameter adjustment method is further described. Figure 4 A flowchart of a method for adjusting database parameters in a HTAP scenario provided by an embodiment of the present specification is shown, which specifically includes the following steps.
[0183] Step 402: Obtain the current running status of the target database, wherein the target database is a hybrid database.
[0184] Step 404: If it is determined based on the current running state that the current memory information reaches the first preset threshold and the current processor information reaches the second preset threshold, the memory resource parameters and the processor resource parameters are determined as the configuration parameters to be modified for the target database.
[0185] The first preset threshold can be Figure 1In the embodiment, in step 104, a series of pre-set state information data monitoring interval sets for memory operation status stored in the DBMS are generated. If the monitored memory operation status information data of the hybrid database exceeds the corresponding monitoring interval, an alarm notification will be issued. The memory status information data monitoring interval can be manually set according to the performance of software and hardware, or can be obtained based on test data using statistical methods, which is not limited here.
[0186] Step 406: Based on the preset modification rule, the configuration parameters are modified to obtain modified configuration parameters.
[0187] Step 408: Allocate memory resources and processor resources according to the modified resource class parameters, run the target database under the allocated memory resources and processor resources, and if the iteration termination condition is met, determine that the resource class parameters have been adjusted.
[0188] Step 410: If it is determined based on the current running state that the current workload information reaches a third preset threshold, the workload class parameters are modified based on preset modification rules to obtain modified workload class parameters.
[0189] The third preset threshold can be Figure 1 In the embodiment, in step 104, a series of pre-set state information data monitoring interval sets for the internal operation state of the database stored in the DBMS, if the monitored database internal operation state information data of the hybrid database exceeds the corresponding monitoring interval, an alarm notification will be issued. The monitoring interval of the internal state information data of the hybrid database can be manually set according to the performance of the software and hardware, or can be obtained by using statistical methods based on test data, which is not limited here.
[0190] Step 412: Allocate workload according to the modified workload class parameters, run the target database under the allocated workload, and if the iteration termination condition is met, determine that the workload class parameters have been adjusted.
[0191] This embodiment is a database parameter adjustment method in the HTAP scenario. The scenario of hybrid transaction analysis and processing requires not only query operations on data but also insert, delete and update operations on data. Therefore, the hybrid database set for the hybrid transaction analysis and processing scenario has a large number of write operations and read operations at the same time. The running state of the analytical database needs to meet the I / O operations on data and the reasonable use of processors at the same time. The relative resource requirements are the memory and processor that the target database can call.
[0192] In one embodiment of the present specification, reasonable causal inference can be made on the process of determining the configuration parameters to be modified and modifying the configuration parameters during the hybrid database parameter adjustment process, so that the database administrator can make a reasonable assessment of the credibility of the above process, because no sampling and model methods are used, and the memory parameters and processor parameters to be modified are determined directly based on the running status of the hybrid database and the parameters are modified based on the modification rules, which is not restricted by the curse of dimensionality. The data I / O operation performance and the reasonable use of processor resources of the target relational database can be further improved under the constraints of system resources and workload.
[0193] Figure 5 The following is an architecture diagram corresponding to a database parameter adjustment method provided by an embodiment of the specification, which mainly includes configuration parameters, operating status and database. The process is mainly as follows: the database is run according to the default configuration parameters; the configuration parameters to be modified are obtained according to the operating status of the database; the configuration parameters are modified based on the preset modification rules to obtain the modified configuration parameters; the database is run again using the modified configuration parameters, and the configuration parameter adjustment is terminated after continuous iteration until the end iteration condition is met. The operating status and configuration parameters in the above architecture are described in detail below.
[0194] Running status: Figure 6 A flowchart of a method for obtaining the operation status of a database provided by an embodiment of the present specification is shown. The internal state of the database is obtained by using the DB state command, the CPU utilization of the database is obtained by using the "sar-u" command, and the I / O state of the disk of the database is obtained by using the "sar-d" command. Based on all the operation states obtained above, the configuration parameters to be modified of the database are determined. The configuration parameters to be modified obtained in this way have strong interpretability, and the configuration parameters to be modified obtained according to the operation state are not affected by the dimensionality curse.
[0195] Configuration parameters: When modifying configuration parameters, there are usually multiple configuration parameters to be modified. Whether all configuration parameters need to be modified at the same time or only some configuration parameters is a question worth paying attention to. If all the above configuration parameters are modified at the same time, it is possible that some of the modified configuration parameters will be restored to their original values due to changes in database performance, which will easily cause the adjustment result to partially meet the preset conditions; and if only one of the configuration parameters is modified, the total parameter adjustment time will increase. In order to solve this problem, Figure 7A schematic diagram of the classification of configuration parameters in a database parameter adjustment method provided by an embodiment of the specification is shown, which divides the configuration parameters into two categories according to their functions: resource parameters and workload parameters, wherein the resource parameters can be further subdivided into three categories: CPU resource parameters, memory resource parameters, and disk resource parameters. Considering that the main purpose of database parameter configuration is to fully utilize resources, and resource parameters are the most direct configuration parameters for allocating resources, the following rules should be followed when modifying configuration parameters: if two types of configuration parameters appear at the same time, only the resource parameters should be modified. In this way, the overall adjustment time can be met, and the number of configuration parameters that are restored to their original values can be reduced.
[0196] Corresponding to the above method embodiment, this specification also provides a database parameter adjustment device embodiment, Figure 8 FIG. 1 is a schematic diagram showing the structure of a database parameter adjustment device provided by an embodiment of the present specification. Figure 8 As shown, the device comprises:
[0197] The acquisition module 802 is configured to acquire the current running status of the target database;
[0198] The determination module 804 is configured to determine the configuration parameters of the target database to be modified based on the current operation state;
[0199] The modification module 806 is configured to modify the configuration parameters based on a preset modification rule to obtain modified configuration parameters;
[0200] The running module 808 is configured to run the target database according to the modified configuration parameters, and if the end iteration condition is met, it is determined that the configuration parameters have been adjusted.
[0201] By applying the embodiments of this specification, the configuration parameters to be modified are obtained based on the operating status of the database, and then the configuration parameters are modified based on the pre-established modification rules, so that the modified configuration parameters have strong interpretability; and, the configuration parameters to be modified are determined based on the operating status of the database without sampling or modeling the configuration parameters, so that when facing the adjustment of high-order spatial parameters with a large number of parameters, they will not be restricted by the curse of dimensionality; finally, iterative adjustment is used to maximize the performance of the target database.
[0202] Optionally, when the target database is run for the first time, the acquisition module 802 is further configured to run the target database according to preset initial configuration parameters to obtain the current running status of the target database.
[0203] Optionally, the acquisition module 802 is further configured to call a database running status acquisition interface to obtain the running status information of the target database from the target database.
[0204] Optionally, the current operating state includes multiple state types; the determination module 804 is further configured to determine, for any state type, whether the state information under the state type reaches a preset threshold corresponding to the state type; if reached, determine the configuration parameters corresponding to the state type as the configuration parameters to be modified.
[0205] Optionally, the modification module 806 is further configured to identify the parameter type of the configuration parameter; if the resource class parameter and the workload class parameter appear in the configuration parameter at the same time, the resource class parameter is modified to obtain the modified configuration parameter.
[0206] Optionally, the modification module 806 is further configured to modify the resource class parameters to obtain modified configuration parameters if only resource class parameters appear in the configuration parameters; or to modify the workload class parameters to obtain modified configuration parameters if only workload class parameters appear in the configuration parameters.
[0207] Optionally, the operation module 808 is further configured to determine that the configuration parameters have been adjusted if it is determined that there are no configuration parameters to be modified based on the operation status obtained from the operation target database; or, to obtain the operation result of the operation target database, and if the operation result reaches the target operation result, determine that the configuration parameters have been adjusted.
[0208] Optionally, the running module 808 is further configured to return to the step of obtaining the current running status of the target database if the iteration termination condition is not met.
[0209] Optionally, the configuration parameters include resource class parameters; the resource class parameters include memory resource parameters; the target database is a relational database;
[0210] The determination module 804 is further configured to determine the memory resource parameter as the configuration parameter to be modified of the target database if it is determined based on the current running state that the current memory information reaches a first preset threshold;
[0211] The running module 808 is further configured to allocate memory resources according to the modified memory resource parameters, run the target database under the allocated memory resources, and determine that the memory resource parameters are adjusted if the iteration termination condition is met.
[0212] Optionally, the configuration parameters include resource class parameters; the resource class parameters include processor resource parameters; the target database is an analytical database;
[0213] The determination module 804 is further configured to determine the processor resource parameter as the configuration parameter to be modified in the target database if it is determined based on the current running state that the current processor information reaches a second preset threshold;
[0214] The running module 808 is further configured to allocate processor resources according to the modified processor resource parameters, run the target database under the allocated processor resources, and determine that the processor resource parameters are adjusted if the end iteration condition is met.
[0215] Optionally, the configuration parameters include resource class parameters; the resource class parameters include memory resource parameters and processor resource parameters; the target database is a hybrid database;
[0216] The determination module 804 is further configured to determine the memory resource parameter and the processor resource parameter as the configuration parameters to be modified of the target database if it is determined based on the current running state that the current memory information reaches a first preset threshold and the current processor information reaches a second preset threshold;
[0217] The running module 808 is further configured to allocate memory resources and processor resources according to the modified resource class parameters, run the target database under the allocated memory resources and processor resources, and determine that the resource class parameters are adjusted if the iteration termination condition is met.
[0218] Optionally, the configuration parameters also include workload class parameters;
[0219] The modification module 806 is further configured to modify the workload class parameter based on a preset modification rule to obtain a modified workload class parameter if it is determined based on the current running state that the current workload information reaches a third preset threshold;
[0220] The running module 808 is further configured to allocate workload according to the modified workload class parameters, run the target database under the allocated workload, and determine that the workload class parameters are adjusted if the iteration termination condition is met.
[0221] The above is a schematic scheme of a database parameter adjustment device of this embodiment. It should be noted that the technical scheme of the database parameter adjustment device and the technical scheme of the above database parameter adjustment method belong to the same concept, and the details not described in detail in the technical scheme of the database parameter adjustment device can be referred to the description of the technical scheme of the above database parameter adjustment method.
[0222] Fig. 9The block diagram of a computing device according to an embodiment of the present specification is shown. The components of the computing device 900 include but are not limited to a memory 910 and a processor 920. The processor 920 is connected to the memory 910 via a bus 930, and the database 950 is used to store data.
[0223] The computing device 900 also includes an access device 940 that enables the computing device 900 to communicate via one or more networks 960. Examples of these networks include a public switched telephone network (PSTN), a local area network (LAN), a wide area network (WAN), a personal area network (PAN), or a combination of communication networks such as the Internet. The access device 940 may include one or more of any type of network interface (e.g., a network interface card (NIC)) that is wired or wireless, such as an IEEE 802.11 wireless local area network (WLAN) wireless interface, a world microwave interconnection access (Wi-MAX) interface, an Ethernet interface, a universal serial bus (USB) interface, a cellular network interface, a Bluetooth interface, a near field communication (NFC) interface, and the like.
[0224] In one embodiment of the present specification, the above components of the computing device 900 and Fig. 9 Other components not shown in the figure may also be connected to each other, for example, via a bus. It should be understood that Fig. 9 The computing device structure block diagram shown is only for the purpose of illustration, and is not intended to limit the scope of this specification. Those skilled in the art can add or replace other components as needed.
[0225] The computing device 900 may be any type of stationary or mobile computing device, including a mobile computer or mobile computing device (e.g., a tablet computer, a personal digital assistant, a laptop computer, a notebook computer, a netbook, etc.), a mobile phone (e.g., a smart phone), a wearable computing device (e.g., a smart watch, smart glasses, etc.), or other types of mobile devices, or a stationary computing device such as a desktop computer or PC. The computing device 900 may also be a mobile or stationary server.
[0226] The processor 920 is used to execute the following computer executable instructions, which, when executed by the processor, implement the steps of the above-mentioned database parameter adjustment method.
[0227] The above is a schematic scheme of a computing device of this embodiment. It should be noted that the technical scheme of the computing device and the technical scheme of the above database parameter adjustment method belong to the same concept, and the details not described in detail in the technical scheme of the computing device can be referred to the description of the technical scheme of the above database parameter adjustment method.
[0228] An embodiment of the present specification further provides a computer-readable storage medium storing computer-executable instructions, which, when executed by a processor, implement the steps of the above-mentioned database parameter adjustment method.
[0229] The above is a schematic scheme of a computer-readable storage medium of this embodiment. It should be noted that the technical scheme of the storage medium and the technical scheme of the above-mentioned database parameter adjustment method belong to the same concept, and the details not described in detail in the technical scheme of the storage medium can be referred to the description of the technical scheme of the above-mentioned database parameter adjustment method.
[0230] An embodiment of the present specification further provides a computer program, wherein when the computer program is executed in a computer, the computer is caused to execute the steps of the above-mentioned database parameter adjustment method.
[0231] The above is a schematic scheme of a computer program of this embodiment. It should be noted that the technical scheme of the computer program and the technical scheme of the above database parameter adjustment method belong to the same concept, and the details not described in detail in the technical scheme of the computer program can be found in the description of the technical scheme of the above database parameter adjustment method.
[0232] The above is a description of a specific embodiment of the specification. Other embodiments are within the scope of the appended claims. In some cases, the actions or steps recorded in the claims can be performed in an order different from that in the embodiments and still achieve the desired results. In addition, the processes depicted in the drawings do not necessarily require the specific order or continuous order shown to achieve the desired results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
[0233] The computer instructions include computer program codes, which may be in source code form, object code form, executable files or some intermediate forms, etc. The computer readable medium may include: any entity or device capable of carrying the computer program code, recording medium, USB flash drive, mobile hard disk, magnetic disk, optical disk, computer memory, read-only memory (ROM), random access memory (RAM), electric carrier signal, telecommunication signal and software distribution medium, etc.
[0234] It should be noted that, for the above-mentioned method embodiments, for the sake of simplicity of description, they are all expressed as a series of action combinations, but those skilled in the art should be aware that the embodiments of this specification are not limited by the order of the actions described, because according to the embodiments of this specification, some steps can be performed in other orders or simultaneously. Secondly, those skilled in the art should also be aware that the embodiments described in the specification are all preferred embodiments, and the actions and modules involved are not necessarily required by the embodiments of this specification.
[0235] In the above embodiments, the description of each embodiment has its own emphasis. For parts that are not described in detail in a certain embodiment, reference can be made to the relevant descriptions of other embodiments.
[0236] The preferred embodiments of this specification disclosed above are only used to help explain this specification. The optional embodiments do not describe all the details in detail, nor do they limit the invention to only the specific implementation methods described. Obviously, many modifications and changes can be made according to the content of the embodiments of this specification. This specification selects and specifically describes these embodiments in order to better explain the principles and practical applications of the embodiments of this specification, so that technicians in the relevant technical field can well understand and use this specification. This specification is only limited by the claims and their full scope and equivalents.
Claims
1. A method for adjusting database parameters, comprising: Acquire the current running status of the target database, wherein the target database includes a relational database, an analytical database, and a hybrid database; Based on the current running state, determine the configuration parameters of the target database to be modified, wherein the configuration parameters include resource class parameters and workload class parameters; when the target database is a relational database, the resource class parameters include memory resource parameters, and based on the current running state, determine the configuration parameters of the target database to be modified, including: if it is determined based on the current running state that the current memory information reaches a first preset threshold, then determine the memory resource parameters as the configuration parameters of the target database to be modified; when the target database is an analytical database, the resource class parameters include processor resource parameters, and based on the current running state, determine the The configuration parameters of the target database to be modified include: if it is determined based on the current running state that the current processor information reaches a second preset threshold, then the processor resource parameters are determined as the configuration parameters of the target database to be modified; when the target database is a hybrid database, the resource class parameters include memory resource parameters and processor resource parameters, and the configuration parameters of the target database to be modified based on the current running state are determined, including: if it is determined based on the current running state that the current memory information reaches a first preset threshold and the current processor information reaches a second preset threshold, then the memory resource parameters and the processor resource parameters are determined as the configuration parameters of the target database to be modified; Based on a preset modification rule, modify the configuration parameter to obtain a modified configuration parameter, wherein the step of modifying the configuration parameter to obtain a modified configuration parameter based on the preset modification rule includes: identifying a parameter type of the configuration parameter to be modified, and modifying a configuration parameter of a corresponding type in the configuration parameter to be modified to obtain a modified configuration parameter; According to the modified configuration parameters, the target database is run, and if the end iteration condition is met, it is determined that the configuration parameters have been adjusted. Wherein, in the case where the target database is a relational database, according to the modified configuration parameters, the target database is run, and if the end iteration condition is met, it is determined that the configuration parameters have been adjusted, including: allocating memory resources according to the modified memory resource parameters, running the target database under the allocated memory resources, and if the end iteration condition is met, it is determined that the memory resource parameters have been adjusted; in the case where the target database is an analytical database, according to the modified configuration parameters, the target database is run, and if the end iteration condition is met, it is determined that the memory resource parameters have been adjusted. The configuration parameters are determined to be adjusted according to the modified processor resource parameters, including: allocating processor resources according to the modified processor resource parameters, running the target database under the allocated processor resources, and if the end iteration condition is met, the processor resource parameters are determined to be adjusted. In the case where the target database is a hybrid database, the target database is run according to the modified configuration parameters, and if the end iteration condition is met, the configuration parameters are determined to be adjusted, including: allocating memory resources and processor resources according to the modified resource class parameters, running the target database under the allocated memory resources and processor resources, and if the end iteration condition is met, the resource class parameters are determined to be adjusted; After determining that the resource class parameters have completed adjustment, it also includes: if it is determined based on the current running state that the current workload information reaches a third preset threshold, then based on the preset modification rules, the workload class parameters are modified to obtain modified workload class parameters; the workload is allocated according to the modified workload class parameters, and the target database is run under the allocated workload. If the iteration end condition is met, it is determined that the workload class parameters have completed adjustment.
2. According to the method of claim 1, when the target database is run for the first time, the step of obtaining the current running status of the target database comprises: According to the preset initial configuration parameters, the target database is run to obtain the current running status of the target database.
3. According to the method of claim 1 or 2, the step of obtaining the current operating status of the target database comprises: The database operation status acquisition interface is called to obtain the operation status of the target database from the target database.
4. The method according to claim 1, wherein the current operating state includes multiple state types; and the step of determining the configuration parameters of the target database to be modified based on the current operating state includes: For any state type, determine whether the state information under the state type reaches the preset threshold corresponding to the state type; If it is reached, the configuration parameters corresponding to the state type are determined as the configuration parameters to be modified.
5. According to the method of claim 1 or 4, the step of modifying the configuration parameters based on the preset modification rules to obtain the modified configuration parameters comprises: If resource class parameters and workload class parameters appear in the configuration parameters at the same time, the resource class parameters are modified to obtain modified configuration parameters.
6. The method according to claim 5, after the step of identifying the parameter type of the configuration parameter, further comprising: If only resource parameters appear in the configuration parameters, modify the resource parameters to obtain modified configuration parameters; or, If only workload parameters appear in the configuration parameters, the workload parameters are modified to obtain modified configuration parameters.
7. The method according to claim 1, wherein if the iteration termination condition is met, the step of determining that the configuration parameter has completed adjustment comprises: If it is determined that there are no configuration parameters to be modified based on the operation status obtained by running the target database, then it is determined that the configuration parameters have been adjusted; or, An operation result of running the target database is obtained, and if the operation result reaches a target operation result, it is determined that the configuration parameter has completed adjustment.
8. The method according to claim 1 or 7, further comprising: If the iteration termination condition is not met, the process returns to the step of obtaining the current running status of the target database.
9. A database parameter adjustment device, comprising: an acquisition module, configured to acquire a current operating state of a target database, wherein the target database includes a relational database, an analytical database, and a hybrid database; A determination module is configured to determine the configuration parameters of the target database to be modified based on the current running state, wherein the configuration parameters include resource class parameters and workload class parameters; when the target database is a relational database, the determination module is further configured to: if it is determined based on the current running state that the current memory information reaches a first preset threshold, then determine the memory resource parameters as the configuration parameters to be modified for the target database; when the target database is an analytical database, the determination module is further configured to: if it is determined based on the current running state that the current processor information reaches a second preset threshold, then determine the processor resource parameters as the configuration parameters to be modified for the target database; when the target database is a hybrid database, the determination module is further configured to: if it is determined based on the current running state that the current memory information reaches a first preset threshold and the current processor information reaches a second preset threshold, then determine the memory resource parameters and the processor resource parameters as the configuration parameters to be modified for the target database; A modification module is configured to modify the configuration parameters based on a preset modification rule to obtain modified configuration parameters, wherein the modification module is further configured to: identify parameter types of the configuration parameters to be modified, and modify configuration parameters of corresponding types in the configuration parameters to be modified to obtain modified configuration parameters; The running module is configured to run the target database according to the modified configuration parameters, and if the end iteration condition is met, it is determined that the configuration parameters have been adjusted. Wherein, when the target database is a relational database, the running module is further configured to: allocate memory resources according to the modified memory resource parameters, and run the target database under the allocated memory resources, and if the end iteration condition is met, it is determined that the memory resource parameters have been adjusted; when the target database is an analytical database, the running module is further configured to: allocate processor resources according to the modified processor resource parameters, and run the target database under the allocated processor resources, and if the end iteration condition is met, it is determined that the processor resource parameters have been adjusted. In the case where the target database is a hybrid database, the operation module is further configured to: allocate memory resources and processor resources according to the modified resource class parameters, operate the target database under the allocated memory resources and processor resources, and if the end iteration condition is met, determine that the resource class parameters have been adjusted; the operation module is further configured to: if it is determined based on the current operating state that the current workload information reaches a third preset threshold, then based on the preset modification rules, modify the workload class parameters to obtain modified workload class parameters; allocate workload according to the modified workload class parameters, operate the target database under the allocated workload, and if the end iteration condition is met, determine that the workload class parameters have been adjusted.
10. A computing device comprising: Memory and processor; The memory is used to store computer executable instructions, and the processor is used to execute the computer executable instructions. When the computer executable instructions are executed by the processor, the steps of the database parameter adjustment method according to any one of claims 1 to 8 are implemented.
11. A computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions, when executed by a processor, implement the steps of the database parameter adjustment method according to any one of claims 1 to 8.
Citation Information
Patent Citations
Database parameter adjustment method and device and computer readable storage medium
CN113064879A