Method for parameter tuning of a load-aware multi-model database arangoDB
By using the benchmarking tools MMDBench and ADBTune framework, combined with random forest regression, K-means, and TD3 algorithms, we solved the problem of inefficient multi-mode database parameter tuning, achieved efficient load perception and parameter tuning, and improved ArangoDB's performance and service quality.
Patent Information
- Application Number
- CN202210365961.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-08
- Publication Date
- 2025-10-24
- Estimated Expiration
- 2042-04-08
AI Technical Summary
Parameter tuning for traditional multi-mode databases is difficult to perform efficiently, especially when faced with dynamic workload changes. Tuning efficiency is low and resources are severely wasted. Existing DBA tuning methods are inefficient and cannot meet the high-performance requirements of multi-mode databases.
Using the benchmark evaluation tool MMDBench and the parameter tuning framework ADBTune, we built a configuration parameter sorting, load perception, and TD3 algorithm-based tuning model to achieve load perception and parameter tuning for ArangoDB. We used random forest regression and K-means algorithms to optimize configuration parameters, and combined them with reinforcement learning algorithms to improve tuning efficiency and accuracy.
It effectively reduces the time and resource waste of multi-mode database parameter tuning, improves the performance and service quality of ArangoDB, adapts to dynamic load changes, and achieves efficient parameter tuning.
Smart Images

Figure CN114706840B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to a method for parameter tuning of a load-aware multi-mode database ArangoDB, belonging to the technical field of software performance evaluation and database-aware tuning. Background Art
[0002] With the rapid development of Internet of Things (IoT) technology and the rapid growth in the number of network applications, the scale of data has exploded, and the data types are becoming increasingly rich. For example, in applications such as "social commerce" and "smart water conservancy," data generally includes structured relational data and semi-structured document-type data. These data are often stored in a dedicated software database system that carries data storage and computing functions. However, traditional relational databases are difficult to meet the needs of applications for data storage and querying with diverse data structures. Therefore, to effectively address the shortcomings of traditional databases, multi-model databases (MMDBs) have been developed. Multi-model databases are an emerging trend in database management systems. Compared with polyglot persistence technologies that use separate data stores to meet various use cases, multi-model databases can store data of all structural forms in a single engine, eliminating the need to deploy different databases for different types of data. Multi-model databases are considered to be the next generation of data management systems that combine flexibility, scalability, and consistency.
[0003] Multimodal databases combine the characteristics of multiple database types (such as document databases and graph databases), providing solutions for storing and managing data in various data models. However, multimodal databases still face the challenge of optimizing configuration parameters. The default configurations provided by the database system often do not achieve optimal performance, and configuration parameters generally require optimization based on the actual workload or application. Parameter tuning has always been a daunting challenge and a significant research task in the field of database optimization. Parameter tuning requires extensive tuning experience and is typically performed by database administrators (DBAs). However, DBA-based tuning for multimodal databases has several limitations: First, DBAs are typically adept at tuning systems they are familiar with and struggle to tune unfamiliar systems. Second, parameter tuning is an NP-hard problem. Faced with hundreds of parameters, DBAs often struggle to optimize the high-dimensional parameter space. Third, because systems can be built in different environments (such as on-premises, in the cloud, or in-memory), DBAs need to spend a significant amount of time tuning the systems in each environment, which significantly impacts tuning efficiency. Finally, in application scenarios, workloads often change dynamically and continuously. The ever-changing workloads also require DBAs to always dynamically tune knobs to achieve high performance, which is obviously very inefficient. Summary of the Invention
[0004] The application aims at the problems and deficiencies in the prior art, and provides a load-aware multi-mode database ArangoDB parameter tuning method, which provides a feasible scheme for maximizing the use of system resources and improving the performance of ArangoDB.
[0005] Technical scheme: The load-aware multi-mode database ArangoDB parameter tuning method comprises a benchmark evaluation tool MMDBench and a parameter tuning framework ADBTune. The ADBTune comprises configuration parameter sorting, load awareness and parameter tuning. Specifically, the method comprises the following steps:
[0006] (1) Constructing a benchmark evaluation tool
[0007] (2) Constructing a configuration parameter selection module
[0008] (3) Constructing a load awareness module
[0009] (4) Constructing a tuning model based on a TD3 algorithm
[0010] In step (1), the benchmark evaluation tool MMDBench is used to evaluate the performance of the executed workloads. It mainly comprises two parts: a load generator and a metric collector. The load generator is used to generate workloads composed of different data request distribution modes and operations of the multi-mode database; the data request distribution modes provide Zipfian (selecting data according to Zipfian distribution), Uniform (reading data with equal probability) and Latest (reading the latest data first) to meet the needs of different scenarios. The metric collector is mainly used to collect performance indicators in the executed load.
[0011] The work load generator provides four parameters of multi-mode database operation, data request distribution mode, thread number and execution time to generate workloads that can simulate actual scenarios. Among them, the multi-mode database operation contains query, addition, update and deletion of three data models of document, key value and graph, and also provides complex aggregation, connection and read-write operation with different proportions of mixed operation. These operations not only cover single model, but also contain cross-model operation of multi-mode data. The thread number is specified by the user, so that the benchmark evaluation tool can generate multiple threads to execute the workload; the execution time is the time for which the workload is executed for stress testing, and if the time exceeds this time, the benchmark evaluation tool MMDBench will cut off the execution operation of all threads. The specific steps for generating the workload are as follows: first, the user specifies the four parameters of the multi-mode database operation, data request distribution mode, thread number and execution time mentioned above, then the work load generator generates a specific workload according to the four parameters, finally, the work load is executed, and the final result is counted by the metric collector.
[0012] The metric collector mainly collects performance indicators in the execution load, that is, the collector records the number of times of executing the work load and the delay of each time, that is, the collector records the number of times of executing the work load and the delay of each time, and then calculates the throughput from the number of times and the execution time parameter, and the delay takes the value of the 99th percentile of all delays.
[0013] In step (2), the configuration parameter selection module is constructed, including configuration parameter sorting, which is used to sort the database parameters to screen important parameters. Specifically, a random forest regression method is used to construct a feature analysis model, and the weights (feature importance weights) of the estimated calculation variables are sorted. After the model is trained, a feature importance parameter_feature_importances is obtained, and the configuration parameters can be sorted according to this parameter. The greater the value, the greater the impact on the result. ADBTune saves the configuration parameter list sorted by ArangoDB according to the feature importance of different tuning indicators by the random forest regression method. It should be noted that the more configuration parameters used for tuning, the higher the final performance improvement rate is often obtained. However, the more parameters, the higher the algorithm complexity, which increases the time complexity of tuning. Therefore, the appropriate configuration parameters can be selected by balancing efficiency and performance improvement rate. For example, if efficiency is pursued, only the top 20 configuration parameters with high importance can be tuned; if performance improvement rate is pursued, all adjustable configuration parameters can be tuned.
[0014] In step (3), the load perception module is used to perceive the change of the work load and search the experience of similar historical loads, which can classify the work load in a fine-grained manner, and the experience knowledge of similar loads can be migrated to the current tuning task to improve the tuning efficiency and performance. Specifically, the database internal state variables are vectorized and standardized by Z-score, so that these variables are on the same order of magnitude, and then the principal component analysis (PCA) method is used for dimensionality reduction processing. Finally, K-means is used to perceive the load change, and if the change occurs, the Pearson correlation coefficient is used to calculate the similarity between the new load and the historical load, the pre-trained model of the work load with the highest similarity after tuning is migrated to the model of the current tuning task, and then the current tuning model is fine-tuned to improve the accuracy and tuning efficiency of the algorithm.
[0015] In step (4), the tuning model is constructed based on the TD3 algorithm, which includes the following steps:
[0016] (41) Randomly initialize the parameters θ of the current actor network μ with the current critic's parameters and Initialize the target actor network parameters θ μ′ and target critic network and Initialize the tuning experience pool β.
[0017] (42) Benchmarking was performed using the benchmark evaluation tool MMDBench under the default configuration to obtain the ArangoDB performance p and the database internal state s.
[0018] (43) If the online tuning phase is in progress, the load sensing module in step (3) will be used to migrate the pre-trained model of the load sensing module to the tuning model under the current tuning task. Otherwise, no migration will be performed. The main difference between online tuning phase and offline tuning phase is whether the phase is provided to users for actual production use. Any phase used in a real scenario is considered online tuning phase.
[0019] (44) Based on the internal state s of the database, a set of configuration parameters a is recommended by the current actor network.
[0020] (45) Adjust the ArangoDB configuration to a and re-run the benchmark using MMDBench to obtain the performance p′ and internal state s′. The reward r is calculated based on the reward function based on p and p′.
[0021] (46) Randomly sample mini-batches (s, s′, a, r) of size N from β to calculate the gradients for updating the critic and actor parameters.
[0022] (48) Repeat (44) to (46) until the model converges or reaches the cutoff condition, and then output the recommended configuration.
[0023] Preferably, in step (45), the reward function is:
[0024]
[0025] Among them, Δ t→0 Indicates the performance improvement rate of ArangoDB relative to the default configuration, Δ t→t-1 Indicates the improvement rate relative to the historical best performance of ArangoDB. t→0 >0 means the current performance is improved compared to the default configuration, Δ t→t-1 > 0 means that the current performance has improved compared to the historical best. Considering that the ultimate goal of tuning is to achieve better performance than the initial setting, we need to reduce the impact of the intermediate tuning process on the design reward function. Therefore, when Δ t→0 The result is positive, and Δt→t-1 When r is negative, set r = 0.
[0026] A parameter tuning system of a load-aware multi-model database ArangoDB comprises a benchmark evaluation tool MMDBench and a parameter tuning tool ADBTune, wherein the ADBTune comprises three modules of configuration parameter sorting, load awareness and parameter tuning; the MMDBench performs a benchmark test after generating a corresponding workload for a tuning task, and then obtains a benchmark test result according to a metric indicator collector; the ADBTune comprises configuration parameter selection, load awareness and tuning algorithm selection; the configuration parameter selection uses a random forest regression algorithm to obtain the correlation between configuration parameters and tuning indicators, and selects configuration parameters for tuning according to the correlation; the load awareness uses a similarity algorithm to calculate the similarity between a current workload and a historical workload library after detecting a workload change by using K-means, and then migrates a pre-trained model obtained by tuning the workload with the highest similarity to a tuning model under a current tuning task; and the tuning algorithm is used to recommend configuration parameters.
[0027] The implementation method of the system is the same as the above method.
[0028] Beneficial effects: In order to maximize the development of the performance of the multi-model database ArangoDB, reduce resource waste and improve service quality, a parameter tuning system of a load-aware multi-model database ArangoDB is proposed, and a construction method thereof is provided; different data request distribution modes such as Zipfian, Uniform and Latest are generated for the data types supported by each multi-model database to meet the needs of different scenarios. In the ArangoDB tuning tool ADBTune, the configuration parameter sorting and load awareness can greatly reduce the tuning time and the final accuracy. Finally, the tuning algorithm is used to realize tuning and output recommended configurations, thereby providing an effective scheme for performance optimization and improvement of service quality of the ArangoDB. BRIEF DESCRIPTION OF DRAWINGS
[0029] Figure 1 The figure is a schematic diagram of the architecture of the embodiment of the application;
[0030] Figure 2 The figure is a flowchart of the parameter tuning of the embodiment of the application. DETAILED DESCRIPTION
[0031] The application will be further illustrated below in conjunction with specific embodiments, and it should be understood that the embodiments are only used to illustrate the application and not used to limit the scope of the application, and after reading the application, various equivalent modifications of the application by those skilled in the art all fall within the scope defined by the claims attached hereto.
[0032] As Figure 1 shown, a parameter tuning system of a load-aware multi-mode database ArangoDB includes a benchmarking tool MMDBench and a parameter tuning tool ADBTune, wherein the ADBTune contains three modules of configuration parameter sorting, load awareness and parameter tuning. The MMDBench generates a corresponding workload for a tuning task and then performs a benchmark test, and then obtains a benchmark test result according to a metric indicator collector; the ADBTune includes configuration parameter selection, load awareness and tuning algorithm selection. The configuration parameter selection is to obtain the correlation between the configuration parameter and the tuning indicator by using a random forest regression algorithm, and the configuration parameter is selected for tuning according to the correlation. The core of the load awareness is to calculate the similarity between the current workload and the historical workload library by using a similarity algorithm after detecting the change of the workload by using K-means, and then migrating the pre-trained model obtained by tuning the workload with the highest similarity to the tuning model under the current tuning task. The tuning algorithm is used to recommend the configuration parameter.
[0033] As Figure 2 shown, the execution steps of the parameter tuning are as follows:
[0034] (1) The tuning model is constructed based on the TD3 algorithm. TD3 contains two parts of an actor and a double critic, the actor adopts two same network structures, a current actor network μ and a target actor network μ'; the double critic contains two current critic networks Q1 and Q2 and two critic target networks Q1' and Q2' with the same network structure, wherein the parameters of the target network adopt a soft updating manner. Therefore, six deep neural networks are used in the tuning model. The parameters θ μ of the current actor network are randomly initialized and the parameters θ μ′ of the target actor network are initialized and the parameters of the target critic network are initialized
[0035] (2) Under the default configuration, the benchmarking tool MMDBench is used to generate a workload, a benchmark test is performed on ArangoDB, and the performance p of ArangoDB is obtained. At the same time, the ADBTune counts the initial running state s of ArangoDB during the execution of the benchmark test.
[0036] (3) Configure the parameter selection module to select configuration parameters with high importance to the performance indicator p based on the importance results obtained by the random forest algorithm. Specifically, after processing by the random forest algorithm, each configuration parameter has a feature weight value in the range [0, 1], and the larger the weight value, the higher the importance.
[0037] (4) If the tuning is an offline training phase, that is, there is no historical tuning data and pre-trained models in the data warehouse, etc., then offline training will be performed to collect tuning data and pre-trained models. This part of the tuning is very time-consuming (specifically, 500 iteration steps are set for training). If it is not an offline training phase, the load sensing module will be used to detect load changes and match the most similar workload based on the Pearson correlation coefficient. The pre-trained model obtained by tuning the similar workload is migrated to the tuning model under the current tuning task for fine-tuning, which can effectively improve the efficiency of tuning (the iteration step is set to 5).
[0038] (5) According to the state s, the actor network recommends a set of configuration parameters a: a = u(s|θ μ ).
[0039] (6) Adjust the ArangoDB configuration to a, and use MMDBench to perform benchmarking again to obtain performance p'. At the same time, ADBTune monitors the internal state s' of ArangoDB. According to p and p', the reward function is calculated to obtain the reward r:
[0040]
[0041] where Δ t→0 represents the performance improvement rate of ArangoDB relative to the default configuration, Δ t→t-1 represents the performance improvement rate of ArangoDB relative to the historical optimal performance. Δ t→0 > 0 indicates that the current performance has improved relative to the default configuration, and Δ t→t-1 > 0 indicates that the current performance has improved relative to the historical optimal performance. Considering that the ultimate goal of tuning is to achieve better performance than the initial setting, we need to reduce the impact of the intermediate process of tuning on the design of the reward function. Therefore, when the result of Δ t→0 is positive and Δ t→t-1 is negative, set r = 0.
[0042] (7) Store the obtained training data quadruple (s, a, r, s') in β. Sample a small batch of samples with a batch size of N from β to train the tuning model, and the current critic network calculates the gradient according to and updates the parameters using the optimizer. Where the target Q value calculated by the current critic according to the state s and the action a is represents the gradient of the Q function with respect to The gradient obtained by derivation, y is the target value, which is calculated by the target network:
[0043]
[0044] Wherein, the value Q output by the target critic network is The action calculated by the target actor network is u'(s'| θ u′ ), γ is the discount rate, γ ∈ [0, 1]. The concept in reinforcement learning, when γ is close to 0, it means that the agent pays more attention to short-term returns, on the contrary, when γ is close to 1, it means that the agent pays more attention to long-term returns.
[0045] According to the delay strategy, the parameters of the current actor network, the target actor network and the target critic network are updated, that is, the critic is updated multiple times (set to 2 in the experiment), and the current actor network, the target actor network and the target critic network will be updated only once. The current actor network updates the parameters according to the gradient , wherein represents the gradient obtained by derivation of the corresponding function with respect to the parameter θ. The parameters of the target actor network and the target critic network are updated as follows:
[0046]
[0047] Wherein, τ is the soft update weight.
[0048] (8) If the termination condition is not reached, set s = s', and then repeat steps (4) to (7), otherwise go to the next stage, which means the end of this time optimization. Termination condition: if load awareness is used, set to 5 times termination, otherwise 500 times. Parameter θ μ 、 and Convergence corresponds to the convergence of the optimized model, which is determined by the change of the loss function. If the change of the loss function tends to be stable, it means that it has converged.
[0049] (9) Output the recommended configuration, and the optimization is completed.
Claims
1. A method for load-aware multi-model database ArangoDB parameter tuning, characterized in that, The benchmark evaluation tool MMDBench and the parameter tuning framework ADBTune are included, wherein the ADBTune contains configuration parameter sorting, load sensing and parameter tuning; and specifically includes the following steps: (1) constructing a benchmark evaluation tool MMDBench to evaluate the performance of an executed workload; (2) constructing a configuration parameter selection module; including configuration parameter sorting, which is used to sort database parameters to filter important parameters; (3) constructing a load sensing module to sense workload changes and search for historical similar load experience; (4) constructing a tuning model based on a TD3 algorithm; In the step (1), the benchmark evaluation tool MMDBench includes a load generator and a metric collector; the load generator is used to generate a workload composed of different data request distribution modes and operations of a multi-mode database; the data request distribution mode includes Zipfian, Uniform and Latest; the metric collector is mainly used to collect performance indicators in the execution load; The workload generator provides four parameters of multi-mode database operations, data request distribution modes, thread numbers and execution times to generate a workload that can simulate an actual scenario; wherein the multi-mode database operations include query, addition, update and deletion operations of three data models of documents, key values and graphs, and also provide aggregation, connection and read-write different proportion mixed operations, which not only cover single models, but also contain cross-model operations of multi-mode data; the thread number is specified by the user, so that the benchmark evaluation tool can generate multiple threads to execute the workload; the execution time is the time for which the workload is executed for stress testing, and if the time exceeds this time, the benchmark evaluation tool MMDBench will cut off the execution operation of all threads; The specific generation of the workload is as follows: first, the user specifies the four parameters of the above multi-mode database operations, data request distribution modes, thread numbers and execution times, then the workload generator generates a specific workload according to the four parameters, and finally the workload is executed, and the final result is counted by the metric collector; In the step (4), the tuning model based on the TD3 algorithm specifically includes the following steps: (41) Randomly initialize the parameters θ of the current critic network μ with the parameters θ of the current critic network Q1 and θ Q2 , initialize the parameters θ of the target critic network μ′ and the target critic network with initialize the tuning experience pool β; (42) using the benchmark evaluation tool MMDBench to perform benchmark testing to obtain ArangoDB performance p and database internal state s; (43) if in the online tuning stage, migrating the pre-training model of the load sensing module to the tuning model under the current tuning task; otherwise, not migrating; (44) according to the database internal state s, recommending a set of configuration parameters a by the current actor network; (45) adjusting the ArangoDB configuration to a, using MMDBench to perform benchmark testing again to obtain performance p' and internal state s'; calculating the reward r according to the reward function according to p and p'; (46) calculating the gradient from a batch of small samples (s, s', a, r) with a random sampling size of β to update the parameters of the critic and the actor; (48) repeating (44)-(46) until the model converges or reaches a cutoff condition, and then outputting the recommended configuration.
2. The method for load-aware multi-model database ArangoDB parameter tuning according to claim 1, wherein, The metric collector is to collect performance indicators in the execution load, that is, in the execution of the workload, the collector records the number of times of executing the workload and the delay of each time, that is, in the execution of the workload, the collector records the number of times of executing the workload and the delay of each time, and then calculates the throughput from the number of times and the execution time parameter, and the delay takes the value of the 99th percentile of all delays.
3. The method for load-aware multi-model database ArangoDB parameter tuning according to claim 1, c h a r a c t e r i z e d i n t h a t, In step (2), in the configuration parameter selection module, a feature analysis model is constructed by using a random forest regression method, and the weights of the estimated calculation variables are sorted; after the model is trained, a feature importance parameter is obtained, and the configuration parameters are sorted according to the feature importance parameter; the greater the impact on the result, the greater the value; the parameter tuning framework ADBTune saves the configuration parameter list sorted by the feature importance of different tuning indicators by the random forest regression method of ArangoDB.
4. The method for load-aware multi-model database ArangoDB parameter tuning according to claim 3, c h a r a c t e r i z e d i n t h a t In step (3), the load perception module is used to perceive the change of the workload and search the experience of the similar historical load, and the workload is classified in a fine-grained manner; specifically, the database internal state variables are vectorized and Z-score standardized, so that the state variables are on the same order of magnitude, and then principal component analysis method is used for dimension reduction processing; finally, K-means is used to perceive the load change, and if the change occurs, the similarity between the new load and the historical load is calculated by using the Pearson correlation coefficient, the pre-trained model of the workload with the highest similarity after tuning is migrated to the model of the current tuning task, and then the current tuning model is fine-tuned.
5. The method for load-aware multi-model database ArangoDB parameter tuning according to claim 1, c h a r a c t e r i z e d i n t h a t, In step (45), the reward function: wherein, Δ t→0 represents the performance improvement rate of ArangoDB relative to the default configuration, Δ t→t-1 represents the performance improvement rate of ArangoDB relative to the historical optimal performance; Δ t→0 > 0 indicates that the current performance is improved relative to the default configuration, Δ t→t-1 > 0 indicates that the current performance is improved relative to the historical optimal performance; when the result of Δ t→0 is positive and Δ t→t-1 is negative, set r = 0.
6. A parameter tuning system for load-aware multi-model database ArangoDB, implemented by the method of claim 1, wherein, includes: The benchmark evaluation tool MMDBench and the parameter tuning tool ADBTune, wherein the ADBTune includes three modules of configuration parameter sorting, load perception and parameter tuning; the MMDBench generates corresponding workloads for the tuning task and then performs benchmark testing, and then obtains the benchmark test results according to the metric collector; the ADBTune includes configuration parameter selection, load perception and tuning algorithm selection; the configuration parameter selection uses a random forest regression algorithm to obtain the correlation between the configuration parameters and the tuning indicators, and selects the configuration parameters for tuning according to the correlation; the load perception calculates the similarity between the current workload and the historical workload library after detecting the change of the workload by using K-means, and then migrates the pre-trained model of the workload with the highest similarity after tuning to the tuning model under the current tuning task; the tuning algorithm is used to recommend configuration parameters.
Citation Information
Patent Citations
Automatic adjustment and optimization method for OrientitDB parameter configuration of multi-model database
CN112131206A