Network simulation data acquisition system and database performance optimization system and method
By implementing data synchronization and database performance optimization in the network simulation data acquisition system, the challenge of massive network data processing and storage is solved, the scalability and performance of the system are improved, and the needs of large-scale network simulation scenarios are met.
Patent Information
- Application Number
- CN202310325003.1
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-03-23
- Publication Date
- 2024-10-01
AI Technical Summary
In space network simulation, especially when simulating large-scale and high-speed network scenarios, the full capture and direct storage of massive network data generated by inter-node communication increases the computer processing and storage burden, and the existing single server hardware configuration cannot meet actual needs. , lack of efficient processing and storage methods.
A network simulation data collection system is designed, including database cluster, simulation node, simulation node server and storage analysis server. Through data synchronization between simulation node server and storage analysis server, the decoupling of data capture, conversion and storage is realized. Use a database performance optimization system to iteratively adjust configuration parameters to achieve optimal performance.
It achieves the maximum horizontal scalability and database performance of the network simulation data collection system, improves the processing efficiency and storage capacity of massive network data, reduces resource contention, and enhances the overall scalability of the system.
Smart Images

Figure CN118740650A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of communication network simulation, and in particular to a network simulation data acquisition system, a database performance optimization system and a method. Background Art
[0002] The analysis of target simulation scenarios in network simulation systems is the most intuitive way to verify the pros and cons of key network technologies, and provides researchers with a basis for technical improvement and optimization. The collection of network simulation data is the basis of network analysis.
[0003] However, in the process of spatial network simulation, especially when simulating large-scale and high-speed network scenarios, communication between nodes can generate massive network data. The full capture and direct storage of massive network data will greatly increase the computer processing and storage burden, and pose a huge challenge to the subsequent network analysis based on the captured data. Therefore, the efficient processing and storage method of massive captured network data is the primary consideration in the specific implementation of network simulation data acquisition, and research on system structure design and component performance tuning is required, but there is little discussion on this at this stage.
[0004] In terms of system structure design, the underlying layer of network simulation data acquisition is built on servers. For a single server, even if the hardware configuration is improved, its performance is still limited and cannot meet actual usage requirements. Summary of the invention
[0005] In order to solve the above technical problems or at least partially solve the above technical problems, the present application provides a network simulation data acquisition system, a database performance optimization system and a method.
[0006] In a first aspect, the present application provides a network simulation data acquisition system, including: a database cluster, a simulation node, a simulation node server, and a storage analysis server;
[0007] The simulation node is connected to the simulation node server for communication, and the simulation node sends the captured network simulation data to the simulation node server;
[0008] The simulation node server is communicatively connected with the storage analysis server, and the simulation node server synchronizes the simulation data to the storage analysis server;
[0009] The storage analysis server is communicatively connected to the database cluster, and the storage analysis server stores the network simulation data in the database cluster.
[0010] Optionally, the simulation node server includes: a first network file system, and the storage analysis server includes: a second network file system, and the first network file system synchronizes the network simulation data to the second network file system in the storage analysis server.
[0011] Optionally, the simulation node includes: a capture container;
[0012] The capture container generates a capture file of a fixed size based on the network simulation data during the process of collecting the network simulation data.
[0013] Optionally, the storage analysis server further includes: a parsing tool and a data collection tool;
[0014] The parsing tool parses the captured file to obtain a parsed file;
[0015] The data collection tool extracts key information from the parsed file in the form of logs one by one to obtain multiple log entries, and writes the multiple log entries into the database cluster.
[0016] In a second aspect, the present application provides a database performance optimization system for optimizing the performance of any database cluster described in the first aspect, wherein the database performance optimization system comprises: an optimizer and a database performance testing tool;
[0017] The optimizer outputs a first configuration parameter to the database cluster;
[0018] The database cluster configures itself using the first configuration parameter;
[0019] The database performance testing tool performs a performance test on the configured database cluster to obtain a performance test result;
[0020] The optimizer outputs second configuration parameters based on the first configuration parameters and the performance test results, uses the second configuration parameters as new first configuration parameters, and reuses the first configuration parameters to configure the database cluster until the database cluster reaches optimal performance or a maximum number of iterations, and outputs the first configuration parameters corresponding to the optimal performance test results.
[0021] In a third aspect, the present application provides a database performance optimization method, comprising:
[0022] Initializing the optimizer so that the optimizer outputs initial configuration parameters, initializes a first change step corresponding to the initial configuration parameters, calculates a first configuration parameter based on the initial configuration parameters and the first change step, and outputs the first configuration parameter to the database cluster so that the database cluster configures itself using the first configuration parameter;
[0023] Use database performance testing tools to perform performance testing on the configured database cluster and obtain performance test results;
[0024] Inputting the performance test result and the first configuration parameter into the optimizer so that the optimizer outputs a second configuration parameter;
[0025] Using the second configuration parameter as a new first configuration parameter, returning to execute the step of configuring the database cluster using the first configuration parameter until the database cluster reaches optimal performance or a maximum number of iterations;
[0026] A first configuration parameter corresponding to a test result obtained when the database cluster reaches an optimal performance or a maximum number of iterations is obtained from the optimizer for use in configuring the database cluster.
[0027] Optionally, inputting the performance test result and the first configuration parameter into the optimizer so that the optimizer outputs a second configuration parameter includes:
[0028] Acquire a first change step corresponding to the first configuration parameter;
[0029] Acquire a positive parameter set and a positive test result under a positive path, and a negative parameter set and a negative test result under a negative path in a previous iteration based on the first configuration parameter and the first change step size;
[0030] Acquire a second change step size used in the next iteration based on the first configuration parameter;
[0031] Determine the larger one of the positive test result and the negative test result, and determine the positive parameter set or the negative parameter set corresponding to the larger one as the basic parameter set;
[0032] Calculate a second configuration parameter set based on the basic parameter set and the second change step size;
[0033] The second configuration parameters are generated based on the second configuration parameter set.
[0034] Optionally, acquiring a second change step size used in a next iteration based on the first configuration parameter includes:
[0035] Obtaining the maximum value and the minimum value of the first configuration parameter;
[0036] Determine the minimum step value based on the maximum value, the minimum value and a preset minimum step value calculation formula;
[0037] Calculating the percentage difference between the positive test result and the negative test result based on the positive parameter set, the negative parameter set and a preset percentage difference calculation formula;
[0038] The second change step size is determined according to the percentage difference, the minimum step size value and a preset change step size calculation formula.
[0039] Optionally, before calculating the second configuration parameter set based on the basic parameter set and the second change step size, the method further includes:
[0040] Obtaining the maximum value and the minimum value of the first configuration parameter;
[0041] Determine the maximum step value based on the maximum value, the minimum value and the preset maximum step value calculation formula;
[0042] Determining whether the calculated second change step size is greater than the maximum step size value;
[0043] If the change step size is greater than the preset maximum step size, the maximum step size is determined as the second change step size.
[0044] In a fourth aspect, the present application provides an electronic device, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other via the communication bus;
[0045] Memory, used to store computer programs;
[0046] The processor is used to implement any database performance optimization method described in the first aspect when executing the program stored in the memory.
[0047] In a fifth aspect, the present application provides a computer-readable storage medium, on which a program of a database performance optimization method is stored. When the program of the database performance optimization method is executed by a processor, the steps of the database performance optimization method described in any one of the first aspects are implemented.
[0048] The above technical solution provided by the embodiment of the present application has the following advantages compared with the prior art:
[0049] The present application realizes network simulation data sharing between the simulation node server and the storage analysis server by synchronizing data between the simulation node server and the storage analysis server, thereby decoupling the data capture, data conversion, and data storage parts on the underlying hardware, and realizing the horizontal scalability of the network simulation data acquisition system. According to actual needs, the network simulation data acquisition system can be horizontally expanded based on the connection structure, such as a one-to-one or many-to-one connection between the simulation node server and the storage analysis server, thereby facilitating the processing of massive network data; on the other hand, the storage analysis server can perform local access to the captured data.
[0050] The present application tests the performance of a database cluster through a database performance testing tool to obtain performance test results. The optimizer continuously optimizes the configuration parameters of the database cluster based on the performance test results with the goal of maximizing the performance of the database cluster, and finally obtains the configuration parameters that optimize the performance of the database cluster, thereby improving the performance of the database cluster under certain hardware resource conditions, improving the tuning efficiency of the database cluster, and improving the tuning effect of the database cluster. BRIEF DESCRIPTION OF THE DRAWINGS
[0051] The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the invention and, together with the description, serve to explain the principles of the invention.
[0052] In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, for ordinary technicians in this field, other drawings can be obtained based on these drawings without paying any creative labor.
[0053] Figure 1 An architecture diagram of a network simulation data acquisition system provided in an embodiment of the present application;
[0054] Figure 2 A structural diagram of a simulation node provided in an embodiment of the present application;
[0055] Figure 3 A schematic diagram of the principle of a network simulation data acquisition system provided in an embodiment of the present application;
[0056] Figure 4 A structural diagram of a database performance optimization system provided in an embodiment of the present application;
[0057] Figure 5 A flowchart of a database performance optimization method provided in an embodiment of the present application;
[0058] Figure 6A flowchart of a database performance optimization method in a practical application provided by an embodiment of the present application;
[0059] Figure 7 A structural diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0060] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application.
[0061] In the process of spatial network simulation, especially when simulating large-scale and high-speed network scenarios, communication between nodes can generate massive network data. The full capture and direct storage of massive network data will greatly increase the computer processing and storage burden, and pose a huge challenge to the subsequent network analysis based on the captured data. Therefore, the efficient processing and storage method of massive captured network data is the primary consideration in the specific implementation of network simulation data acquisition, and research on system structure design and component performance tuning is needed, but there is little discussion on this at this stage.
[0062] In terms of system structure design, the underlying layer of network simulation data acquisition is based on server construction. For a single server, even if the hardware configuration is improved, its performance is still limited and cannot meet the actual usage requirements. To this end, this application first provides an architecture of a network simulation data acquisition system, which consists of a capture layer, a storage layer, and an analysis layer. Figure 1 shown.
[0063] 1) Capture layer
[0064] The capture layer includes two functions, namely link information collection and full data packet capture. Because the connection relationship and link characteristics between the simulation nodes of the simulation platform change dynamically, the capture layer is integrated with the simulation node based on virtualization technology to realize simulation data collection under dynamic network changes. In the space network simulation system, simulation nodes can be created and managed through container management tools. Kubernetes (K8S) is used as an example here. The simulation node is orchestrated with Pod as the basic deployment unit. Each simulation node contains two containers, namely the simulation container and the capture container. Its structure is as follows: Figure 2 As shown in the figure, the capture container supports full packet capture. The captured network traffic is stored in pcap format and awaits subsequent processing by the storage layer.
[0065] 2) Storage Layer
[0066] The storage layer obtains data from the capture layer and provides a data source for the analysis layer. It is divided into two parts: data conversion and storage. In large-scale simulation scenarios, the massive pcap data captured by the full data packet contains a large amount of redundant information. Indiscriminate storage will greatly increase the burden of data storage and analysis. According to the analysis requirements, the key information of each data packet should be extracted from the original captured traffic in advance and transferred to a json format file in the form of logs one by one. This process can be supported by libpcap-based applications (such as Tshark). Finally, the converted file is written to the database through a log collection tool (such as Filebeat).
[0067] 3) Analysis layer
[0068] The analysis layer is implemented based on the big data analysis framework. It uses the key field information in the data packet to screen the data packet records in the storage layer and provide network performance analysis functions. In this way, as long as the record contains the corresponding query information and the analysis logic is correct, performance analysis can be performed on any protocol type.
[0069] Based on the architecture of the above network simulation data acquisition system, Figure 1 As shown, the embodiment of the present application provides a network simulation data acquisition system, which includes: a database cluster 11, a simulation node 12, a simulation node server 13 and a storage analysis server 14;
[0070] The simulation node 12 is in communication connection with the simulation node server 13, and the simulation node 12 sends the captured network simulation data to the simulation node server 13;
[0071] In an embodiment of the present application, the simulation node is created based on virtualization technology and has data capture capabilities for capturing network simulation data and sending the captured network simulation data to a simulation node server. The simulation node can run on the simulation node server or can be set up separately from the simulation node server.
[0072] The simulation node server 13 is in communication connection with the storage analysis server 14, and the simulation node server synchronizes the simulation data to the storage analysis server. The simulation node server 13 includes: a first network file system, and the first network file system synchronizes the network simulation data to a second network file system in the storage analysis server 14;
[0073] The simulation node server can be connected to the storage and analysis server in a one-to-one or many-to-one manner to achieve horizontal expansion of simulation data collection and analysis.
[0074] The first network file system is used to synchronize the network simulation data to the second network file system in the storage analysis server. That is to say, the purpose of setting up the network file system (NFS) in the simulation node server and the storage analysis server respectively is to synchronize the network simulation data captured by the simulation node to the storage analysis server. Therefore, on the one hand, the storage analysis server can locally access the captured data; on the other hand, the underlying structure of the capture part and the storage part is decoupled.
[0075] In an embodiment of the present application, network simulation data sharing between the simulation node server and the storage analysis server can be implemented based on the Network File System (NFS), thereby decoupling the data capture, data conversion, and data storage parts on the underlying hardware, thereby realizing the horizontal scalability of the network simulation data acquisition system.
[0076] The storage analysis server 14 is in communication connection with the database cluster 11 , and the storage analysis server 14 includes: a second network file system, and the storage analysis server 14 stores the network simulation data into the database cluster 11 .
[0077] In an embodiment of the present application, the database cluster 11 is created based on virtualization technology and is used to store network simulation data. The database cluster 11 can run on a storage and analysis server, or can be set up separately from the storage and analysis server. Exemplarily, the database cluster 11 can be an (Elasticsearch, ES) cluster.
[0078] The present application realizes network simulation data sharing between the simulation node server and the storage analysis server by synchronizing data between the simulation node server and the storage analysis server, thereby decoupling the data capture, data conversion, and data storage parts on the underlying hardware, and realizing the horizontal scalability of the network simulation data acquisition system. According to actual needs, the network simulation data acquisition system can be horizontally expanded based on the connection structure, such as a one-to-one or many-to-one connection between the simulation node server and the storage analysis server, thereby facilitating the processing of massive network data; on the other hand, the storage analysis server can perform local access to the captured data.
[0079] In another embodiment of the present application, in order to reduce or avoid the competition for resources required by each simulation node in the network simulation data acquisition system and enhance the overall scalability of the system, the capture part (capture layer) and the storage part (storage layer) of the network simulation data acquisition system adopt Figure 3 The simulation node server achieves full data packet capture by sharing network resources with each container of the simulation node.
[0080] In the embodiment of the present application, the simulation node 12 includes: a capture container;
[0081] The capture container generates a capture file of a fixed size based on the network simulation data during the process of collecting the network simulation data.
[0082] In the present application embodiment, Figure 3 As shown, under the parallel processing structure, when the simulation node in the capture layer performs full data packet capture, the capture container in the simulation node generates a capture file with a fixed size; when the capture file exceeds the specified size, a new file is created to record subsequent data; then, multiple capture files are processed in parallel in a thread pool-like manner, and the processing process includes parsing the original capture file, extracting the key information of each data packet in the capture file in the form of logs one by one, and writing the logs to the database.
[0083] The present application generates a fixed-size capture file based on the network simulation data through a capture container, which can realize a parallel data processing structure and facilitate the effective use of the inherent hardware resources of the server.
[0084] In yet another embodiment of the present application, the storage analysis server further includes: a parsing tool and a data collection tool;
[0085] The parsing tool parses the captured file to obtain a parsed file;
[0086] The data collection tool extracts key information from the parsed file in the form of log entries one by one to obtain multiple log entries, and writes the multiple log entries into the database cluster 11 .
[0087] Exemplarily, the parsing tool may be Tshark, and the data collection tool may be Filebeat.
[0088] For each captured pcap original file of network simulation data, the parsing tool Tshark is first parsed into a Json file, and then the key information in each data packet is extracted in the form of logs one by one through the data collection tool Filebeat, and written into the database cluster for storage, realizing compressed storage of massive data.
[0089] This application can specify the maximum number of parsing tools Tshark and data collection tools Filebeat running simultaneously in a thread pool-like manner to avoid server crashes due to excessive resource occupation.
[0090] The embodiment of the present application extracts and records the key information of each data packet in the form of logs one by one and stores it, which greatly compresses the amount of data that needs to be processed in the storage and query process, reduces the disk space required for data storage, and improves the efficiency of data analysis. Table 1 shows the comparison of the data volume and source pcap file in different data formats, and the data compression ratio reaches 22:1.
[0091] Table 1 Storage space required for files in different data formats
[0092] pcap file (MB) Json file (MB) ES Index (MB) 1100 62.0 48.2 2000 120.0 93.5 4000 232.3 178.7 8100 476.0 366.0
[0093] The following uses the database cluster as the optimization object and ESRally as the performance testing tool as an example to illustrate the simulation data acquisition system in the embodiment of the present application. Figure 4 As shown in the figure, the database cluster, database performance testing tool ESRally, and optimizer are all deployed in the form of virtualized or physical machines and are interconnected.
[0094] The database cluster contains multiple ES nodes. Each ES node uses port 9200 and is exposed to the outside in the form of "[node name]:9200" to provide database services.
[0095] ESRally completes the performance test of the database cluster based on the ESRally configuration file generated by the optimizer, including the number of parallel operations, the number of data entries written at a time, etc. The statistical results obtained from the test will be recorded by ESRally in real time and stored in the form of a JSON file.
[0096] The optimizer reads the statistical results generated by ESRally, and calculates the configuration parameters of the database cluster and ESRally in the next round of testing based on the current database cluster configuration. Then, the optimizer adjusts the database cluster according to the new configuration parameters and notifies ESRally to conduct the next round of testing. The above collaborative process of the database cluster, ESRally, and the optimizer will continue to iterate until the database cluster reaches the optimal performance or the maximum number of iterations, and then outputs the optimal configuration of the current database cluster.
[0097] In addition, the optimizer is also responsible for monitoring the database cluster hardware resources during the entire experiment, including CPU and memory usage, to ensure that the database cluster will not be overloaded due to configuration reasons. This is because the configuration value corresponding to the resource overload moment, even if the performance of the database cluster is maximized, lacks practical deployment significance.
[0098] like Figure 3As shown, an embodiment of the present application provides a database performance optimization system for optimizing the performance of a database cluster described in any of the aforementioned embodiments, and the database performance optimization system includes: an optimizer 15 and a database performance testing tool 16;
[0099] The optimizer 15 outputs a first configuration parameter to the database cluster 11;
[0100] The database cluster 11 configures itself using the first configuration parameters;
[0101] The database performance testing tool 16 performs a performance test on the configured database cluster 11 to obtain a performance test result;
[0102] After the database cluster completes the configuration of the first configuration parameter, the database performance testing tool 16 retests the database cluster, such as writing data to the database cluster, performing data query, etc. At the same time, the database performance testing tool 16 will also monitor the hardware usage of the database cluster 11 during the test, such as CPU usage, memory occupancy, etc. The performance test results can be written into the file record.
[0103] The optimizer 15 outputs second configuration parameters based on the first configuration parameters and the performance test results, uses the second configuration parameters as new first configuration parameters, and reuses the first configuration parameters to configure the database cluster 11 until the database cluster 11 reaches the optimal performance or the maximum number of iterations, and outputs the first configuration parameters corresponding to the optimal performance test results.
[0104] The optimizer in the embodiment of the present application is based on a gradient descent algorithm, such as the Simultaneous Perturbation Stochastic Approximation (SPSA) algorithm, which takes the first configuration parameter of the database cluster as input, aims to maximize the performance of the database cluster, and iteratively adjusts the configuration parameters of the database cluster according to the performance test results of the performance test of the database cluster by a database performance testing tool, and outputs the optimal configuration under the conditions of determined hardware resources.
[0105] In addition, the optimizer is also responsible for monitoring the database cluster hardware resources during the entire experiment, including CPU usage, memory usage, etc., to ensure that the database cluster will not cause hardware resource overload due to configuration reasons. This is because the configuration value corresponding to the resource overload moment, even if the performance of the database cluster is maximized, lacks practical deployment significance.
[0106] The present application tests the performance of a database cluster through a database performance testing tool to obtain performance test results. The optimizer continuously optimizes the configuration parameters of the database cluster based on the performance test results with the goal of maximizing the performance of the database cluster, and finally obtains the configuration parameters that optimize the performance of the database cluster, thereby improving the performance of the database cluster under certain hardware resource conditions, improving the tuning efficiency of the database cluster, and improving the tuning effect of the database cluster.
[0107] In another embodiment of the present application, a database performance optimization method is also provided, which can be applied to the database performance optimization system of the above embodiment. Figure 5 As shown, the method includes:
[0108] Step S101, initializing the optimizer so that the optimizer outputs initial configuration parameters, initializes a first change step corresponding to the initial configuration parameters, calculates a first configuration parameter based on the initial configuration parameters and the first change step, and outputs the first configuration parameter to the database cluster so that the database cluster configures itself using the first configuration parameter;
[0109] In an embodiment of the present application, the optimizer is based on a gradient descent algorithm, takes the initialization configuration parameters of the database cluster as input, takes maximizing the performance of the database cluster as the goal, iteratively adjusts the configuration parameters of the database cluster according to the test results of the performance test of the database cluster by a database performance testing tool, and outputs the optimal configuration under the conditions of determined hardware resources.
[0110] Exemplarily, the gradient descent algorithm may be a Simultaneous Perturbation Stochastic Approximation (SPSA) algorithm.
[0111] The SPSA algorithm can be applied to objective functions that do not have a specific formula for analysis, but can be used to solve approximate problems based on noise observations. Noise observations are used to find a parameter estimation order, which can be expressed as The optimization goal here is to maximize the performance test results of the database cluster (such as write throughput).
[0112] First, we can construct the optimization objective function of the gradient descent algorithm. The objective function formula is f(θ) = indexing, where indexing is the performance test result. For example, the performance test result can be the average write throughput of the database cluster, which is represented by the number of data entries written per second in the ES database cluster; θ is the configuration parameter set vector of the ES database cluster; correspondingly, Δ is the change step size, which will be superimposed on the configuration parameters of the previous iteration as the configuration parameters of the new iteration. The objective function in the algorithm uses ESRally as a performance testing tool to obtain the write throughput of the database cluster under different parameter configurations.
[0113] Each configuration parameter in the configuration parameter set has its corresponding value range, that is, there is a minimum and maximum value; the step size also has a corresponding minimum and maximum value, which depends on the range of the parameter value. For the nth parameter P in the parameter set vector θ about the configuration parameter set n , its minimum step value P nSZmin It can be calculated by formula (1). nmin is the parameter P n The minimum value of P nmax is the parameter P n The maximum value of can be calculated by formula (2).
[0114]
[0115] The corresponding parameter P n The maximum step length P nSZmax It can be calculated by formula 2.
[0116]
[0117] In this step, the optimizer can be initialized to obtain the initial configuration parameters for configuring the database cluster, that is, the initial value of the configuration parameter set vector θ, and the parameter value range corresponding to each configuration parameter is initialized [P nmin ,P nmax ], initialize the change step vector Δ of each configuration parameter, and generate the first change step vector about the first change step The first configuration parameter is calculated based on the initial configuration parameter and the first change step, that is, +θ=θ n-1 +Δ n and f(+θ), -θ=θ n-1 -Δ n and f(-θ).
[0118] The first configuration parameters include a positive parameter set under a positive path and a negative parameter set under a negative path, wherein the positive path refers to the "+" direction and the negative path refers to the "-" direction, the positive parameter set is obtained by adding a first change step to an initial parameter set, and the negative parameter set is obtained by subtracting the first change step from the initial parameter set.
[0119] The database cluster may configure itself using the positive parameter set and the negative parameter set in the first configuration parameters respectively.
[0120] Step S102, using a database performance testing tool to perform a performance test on the configured database cluster to obtain a performance test result;
[0121] The performance test results include the positive test result f(+θ) under the positive path and the negative test result f(-θ) under the negative path in the current iteration.
[0122] After the database cluster is configured using the forward parameter set, you can use the database performance test to obtain the forward test results during the operation of the database cluster.
[0123] After the database cluster is configured using the negative parameter set, you can use the database performance test to obtain negative test results during the operation of the database cluster.
[0124] Step S103, inputting the performance test result and the first configuration parameter into the optimizer, so that the optimizer outputs a second configuration parameter;
[0125] In this step, according to the magnitude of the positive test result and the negative test result, one of the positive parameter set and the negative parameter set can be selected as a basic test parameter set, and then the updated second change step length Δ n+1 , and then the optimizer outputs the second configuration parameters based on the basic test parameter set and the second change step size. Similarly, the second configuration parameters include a positive parameter set under the positive path and a negative parameter set under the negative path.
[0126] Step S104, using the second configuration parameter as a new first configuration parameter, and returning to execute the step of configuring the database cluster using the first configuration parameter until the database cluster reaches optimal performance or a maximum number of iterations;
[0127] The database cluster is configured using the second configuration parameters, and the above process is repeated until the performance of the database cluster reaches the optimum or reaches a preset maximum number of iterations.
[0128] Step S105 : obtaining, from the optimizer, a first configuration parameter corresponding to a test result obtained when the database cluster reaches an optimal performance or a maximum number of iterations, for use in configuring the database cluster.
[0129] The present application tests the performance of a database cluster through a database performance testing tool to obtain performance test results. The optimizer continuously optimizes the configuration parameters of the database cluster based on the performance test results with the goal of maximizing the performance of the database cluster, and finally obtains the configuration parameters that optimize the performance of the database cluster, thereby improving the performance of the database cluster under certain hardware resource conditions, improving the tuning efficiency of the database cluster, and improving the tuning effect of the database cluster.
[0130] In another embodiment of the present application, step S103 inputs the performance test result and the first configuration parameter into the optimizer so that the optimizer outputs the second configuration parameter, including:
[0131] Step S201, obtaining a first change step corresponding to the first configuration parameter;
[0132] During initialization, the initial configuration parameters can be obtained, and the initial change step can be obtained as the first configuration parameters and the first change step; in each iteration, new configuration parameters are generated as the first configuration parameters, and the updated change step can be obtained as the first change step. Therefore, in this step, the first configuration parameters and the first change step used in the current iteration can be obtained.
[0133] Step S202, obtaining a positive parameter set and a positive test result under a positive path, and a negative parameter set and a negative test result under a negative path in a previous iteration based on the first configuration parameter and the first change step size;
[0134] In this step, the first configuration parameter may be added to the first change step to obtain a positive parameter set under a positive path, and the first configuration parameter may be subtracted from the first change step to obtain a negative parameter set under a negative path;
[0135] Use the database performance testing tool to perform performance testing on the database cluster configured by the positive parameter set to obtain positive test results; use the database performance testing tool to perform performance testing on the database cluster configured by the negative parameter set to obtain negative test results.
[0136] Step S203, obtaining a second change step size used in the next iteration based on the first configuration parameter;
[0137] In the embodiment of the present application, at each iteration, the change step size used in the next iteration is determined based on the current first configuration parameter and a preset change step size calculation formula to calculate the second configuration parameter used in the next iteration.
[0138] Step S204, determining the larger one of the positive test result and the negative test result, and determining the positive parameter set or the negative parameter set corresponding to the larger one as the basic parameter set;
[0139] In this step, the positive test result and the negative test result can be compared to obtain the larger one of the two. If the larger one is the positive test result, the positive parameter set corresponding to the positive test result is determined as the basic parameter set. If the larger one is the negative test result, the negative parameter set corresponding to the negative test result is determined as the basic parameter set.
[0140] Step S205, calculating a second configuration parameter set based on the basic parameter set and the second change step size;
[0141] The positive parameter set in the second configuration parameters is obtained by adding the second change step length to the basic parameter set, and the negative parameter set in the second configuration parameters is obtained by subtracting the second change step length from the basic parameter set.
[0142] Step S206: Generate the second configuration parameter based on the second configuration parameter set.
[0143] A parameter vector is generated based on all parameters in the second configuration parameter set to obtain second configuration parameters.
[0144] In another embodiment of the present application, step S203 of acquiring a second change step size used in the next iteration based on the first configuration parameter includes:
[0145] Step S301, obtaining the maximum value and the minimum value of the first configuration parameter;
[0146] Each configuration parameter has a value range, that is, there is a minimum value and a maximum value, so the maximum value can be obtained from the first configuration parameter, and the minimum value can be obtained from the first configuration parameter.
[0147] Step S302, determining a minimum step value based on the maximum value, the minimum value and a preset minimum step value calculation formula;
[0148] The minimum step length calculation formula is formula (1), and the maximum value is P nmax , the minimum value is P nmin , substitute the maximum and minimum values into the minimum step value calculation formula to get the minimum step value.
[0149] Step S303, calculating the percentage difference between the positive test result and the negative test result based on the positive parameter set, the negative parameter set and a preset percentage difference calculation formula;
[0150] For each iteration, the step value of each parameter will be updated according to the objective function of each f(+θ) and f(-θ). The new step value is calculated by formula (3). Where DP is the difference percentage between f(+θ) and f(-θ), DP∈[0,1], which can be calculated by formula (4). If the step value exceeds the maximum step value, the new step value is the maximum step value P nSZmax .
[0151] StepSize = P nSZmin ×(1+DP) (3)
[0152]
[0153] The percentage difference calculation formula is formula (4), and the forward parameter set is f(θ n-1 +Δ n ), the negative parameter set is f(θ n-1 -Δ n ), the positive parameter set and the negative parameter set are respectively substituted into the percentage difference calculation formula to obtain the percentage difference between the positive test result and the negative test result.
[0154] Step S304: determining the second change step size according to the percentage difference, the minimum step size value and a preset change step size calculation formula.
[0155] The formula for calculating the change step size is formula (3), the percentage difference is DP, and the minimum step size is P nSZmin , bring the percentage difference and percentage difference into the change step calculation formula to obtain the second change step used in the next iteration, that is, the updated change step.
[0156] In order to facilitate understanding of the above method embodiments, Figure 6 As shown, the present application provides an embodiment in practical application, as follows:
[0157] Step S1: Initialize the configuration parameters of the database cluster, that is, the initial value of the θ parameter vector, and the parameter value range corresponding to each parameter [P nmin ,P nmax ];
[0158] Step S2: Initialize the change step vector Δ of each configuration parameter;
[0159] Step S3: Generate step vector And calculate +θ=θ n-1 +Δ n and f(+θ), -θ=θ n-1 -Δ nand f(-θ); then, the percentage difference between f(+θ) and f(-θ) is calculated by equation 4, and the change step vector Δ of the configuration parameters is calculated by equation 3 n+1 ; Finally, based on the results of f(+θ) and f(-θ), the optimal solution is used as the updated value of θ.
[0160] Step S4: Iterate the calculation process in (3), with the initial number of iterations being 1 and the number of iterations being N.
[0161] Step S5: Return the obtained configuration parameter vector θ.
[0162] In another embodiment of the present application, before calculating the second configuration parameter set based on the basic parameter set and the second change step size in step S205, the method further includes:
[0163] Step S401, obtaining the maximum value and the minimum value of the first configuration parameter;
[0164] Each configuration parameter has a value range, that is, there is a minimum value and a maximum value, so the maximum value can be obtained from the first configuration parameter, and the minimum value can be obtained from the first configuration parameter.
[0165] Step S402, determining a maximum step value based on the maximum value, the minimum value and a preset maximum step value calculation formula;
[0166] The maximum step length calculation formula is formula (2), and the maximum value is P nmax , the minimum value is P nmin , substitute the maximum and minimum values into the maximum step length calculation formula to obtain the maximum step length value.
[0167] Step S403, determining whether the calculated second change step size is greater than the maximum step size value;
[0168] The second change step length calculated in step S203 is compared with the maximum step length value. If the second change step length is smaller than the maximum step length value, the second change step length calculated in step S203 is directly determined as the second change step length.
[0169] Step S404: If the change step size is greater than the preset maximum step size, the maximum step size is determined as the second change step size.
[0170] The embodiment of the present application can automatically determine the second change step length, thereby preventing the second change step length from being too large and exceeding the maximum step length value, thereby affecting the accuracy of each adjustment of the database cluster performance.
[0171] In another embodiment of the present application, an electronic device is provided, including a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus;
[0172] Memory, used to store computer programs;
[0173] The processor is used to implement any of the above-mentioned database performance optimization methods when executing the program stored in the memory.
[0174] In the electronic device provided by the embodiment of the present invention, the processor tests the performance of the database cluster through a database performance testing tool by executing a program stored in the memory to obtain a performance test result, and the optimizer continuously optimizes the configuration parameters of the database cluster according to the performance test result with the goal of maximizing the performance of the database cluster, and finally obtains the configuration parameters that optimize the performance of the database cluster, thereby improving the performance of the database cluster under certain hardware resource conditions, improving the tuning efficiency of the database cluster, and improving the tuning effect of the database cluster.
[0175] The communication bus 1140 mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus. The communication bus 1140 can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, Figure 7 Only one thick line is used in the diagram, but this does not mean that there is only one bus or only one type of bus.
[0176] The communication interface 1120 is used for communication between the above electronic device and other devices.
[0177] The memory 1130 may include a random access memory (RAM) or a non-volatile memory, such as at least one disk memory. Optionally, the memory may also be at least one storage device located away from the aforementioned processor.
[0178] The above-mentioned processor 1110 can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components.
[0179] In another embodiment of the present application, a computer-readable storage medium is provided, on which a program of a database performance optimization method is stored. When the program of the database performance optimization method is executed by a processor, the steps of any of the aforementioned database performance optimization methods are implemented.
[0180] It should be noted that, in this article, relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0181] The foregoing is merely a specific embodiment of the present invention, which enables those skilled in the art to understand or implement the present invention. Various modifications to these embodiments will be apparent to those skilled in the art, and the general principles defined herein may be implemented in other embodiments without departing from the spirit or scope of the present invention. Therefore, the present invention will not be limited to the embodiments shown herein, but rather to the widest scope consistent with the principles and novel features claimed herein.
Claims
1. A network simulation data acquisition system, characterized in that: include: Database cluster, simulation node, simulation node server and storage analysis server; The simulation node is connected to the simulation node server for communication, and the simulation node sends the captured network simulation data to the simulation node server; The simulation node server is communicatively connected with the storage analysis server, and the simulation node server synchronizes the simulation data to the storage analysis server; The storage analysis server is communicatively connected to the database cluster, and the storage analysis server stores the network simulation data in the database cluster.
2. The network simulation data acquisition system according to claim 1, characterized in that: The simulation node server includes: a first network file system, and the storage analysis server includes: a second network file system, and the first network file system synchronizes the network simulation data to the second network file system in the storage analysis server.
3. The network simulation data acquisition system according to claim 1, characterized in that: The simulation node includes: a capture container; The capture container generates a capture file of a fixed size based on the network simulation data during the process of collecting the network simulation data.
4. The network simulation data acquisition system according to claim 1, characterized in that: The storage analysis server also includes: a parsing tool and a data collection tool; The parsing tool parses the captured file to obtain a parsed file; The data collection tool extracts key information from the parsed file in the form of logs one by one to obtain multiple log entries, and writes the multiple log entries into the database cluster.
5. A database performance optimization system, characterized in that: Used to optimize the performance of the database cluster according to any one of claims 1 to 4, the database performance optimization system comprises: an optimizer and a database performance testing tool; The optimizer outputs a first configuration parameter to the database cluster; The database cluster configures itself using the first configuration parameter; The database performance testing tool performs a performance test on the configured database cluster to obtain a performance test result; The optimizer outputs second configuration parameters based on the first configuration parameters and the performance test results, uses the second configuration parameters as new first configuration parameters, and reuses the first configuration parameters to configure the database cluster until the database cluster reaches optimal performance or a maximum number of iterations, and outputs the first configuration parameters corresponding to the optimal performance test results.
6. A database performance optimization method, characterized in that: Applied to a database performance optimization system, the method comprises: Initializing the optimizer so that the optimizer outputs initial configuration parameters, initializes a first change step corresponding to the initial configuration parameters, calculates a first configuration parameter based on the initial configuration parameters and the first change step, and outputs the first configuration parameter to the database cluster so that the database cluster configures itself using the first configuration parameter; Use database performance testing tools to perform performance testing on the configured database cluster and obtain performance test results; Inputting the performance test result and the first configuration parameter into the optimizer so that the optimizer outputs a second configuration parameter; Using the second configuration parameter as a new first configuration parameter, returning to execute the step of configuring the database cluster using the first configuration parameter until the database cluster reaches optimal performance or a maximum number of iterations; A first configuration parameter corresponding to a test result obtained when the database cluster reaches an optimal performance or a maximum number of iterations is obtained from the optimizer for use in configuring the database cluster.
7. The method according to claim 6, characterized in that Inputting the performance test result and the first configuration parameter into the optimizer so that the optimizer outputs a second configuration parameter includes: Acquire a first change step corresponding to the first configuration parameter; Acquire a positive parameter set and a positive test result under a positive path, and a negative parameter set and a negative test result under a negative path in a previous iteration based on the first configuration parameter and the first change step size; Acquire a second change step size used in the next iteration based on the first configuration parameter; Determine the larger one of the positive test result and the negative test result, and determine the positive parameter set or the negative parameter set corresponding to the larger one as the basic parameter set; Calculate a second configuration parameter set based on the basic parameter set and the second change step size; The second configuration parameters are generated based on the second configuration parameter set.
8. The method according to claim 7, characterized in that Acquiring a second change step size used in the next iteration based on the first configuration parameter includes: Obtaining the maximum value and the minimum value of the first configuration parameter; Determine the minimum step value based on the maximum value, the minimum value and a preset minimum step value calculation formula; Calculating the percentage difference between the positive test result and the negative test result based on the positive parameter set, the negative parameter set and a preset percentage difference calculation formula; The second change step size is determined according to the percentage difference, the minimum step size value and a preset change step size calculation formula.
9. The method according to claim 7, characterized in that: Before calculating the second configuration parameter set based on the basic parameter set and the second change step size, the method further includes: Obtaining the maximum value and the minimum value of the first configuration parameter; Determine the maximum step value based on the maximum value, the minimum value and the preset maximum step value calculation formula; Determining whether the calculated second change step size is greater than the maximum step size value; If the change step size is greater than the preset maximum step size, the maximum step size is determined as the second change step size.
10. An electronic device, characterized in that: It includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; Memory, used to store computer programs; The processor is used to implement the database performance optimization method described in any one of claims 6 to 9 when executing the program stored in the memory.
11. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores a program of a database performance optimization method, and when the program of the database performance optimization method is executed by a processor, the steps of the database performance optimization method described in any one of claims 6 to 9 are implemented.
