A database load analysis method for query-intensive data storage and processing systems
By combining theoretical and experimental methods, using unique calculation formulas and benchmark tests, we solve the problem of inaccurate database load analysis in the existing technology, achieve efficient and accurate load analysis in a distributed architecture, and reduce resource waste. and cost.
Patent Information
- Application Number
- CN202011199174.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-11-01
- Publication Date
- 2024-09-17
- Estimated Expiration
- 2040-11-01
AI Technical Summary
Existing database load analysis methods fail to accurately reflect the impact of data volume in the database when considering operating system versions and other software occupancy factors, resulting in inaccurate analysis results, especially resource waste and cost when database load is frequently analyzed in a distributed architecture. Increase.
Using a method that combines theory and experiment, we obtain performance information through benchmark tests, and use unique calculation formulas to consider the impact of data volume and concurrent requests in the database, calculate the average load and peak load of the database respectively, and optimize index column query tasks. Reduce the need to run simulation scripts frequently.
It achieves the accuracy and efficiency of database load analysis in a distributed architecture, saves computer performance and energy resources, reduces operating costs, and is suitable for databases with many data tables and large differences in data volume.
Smart Images

Figure CN112307042B
Abstract
Description
Technical Field
[0001] The present invention relates to the field of database load analysis methods, in particular to a database load analysis method for a query-intensive data storage and processing system. Background Art
[0002] At present, with the continuous development of the information age, the total amount of data in all walks of life has shown explosive growth. In order to obtain target data from massive data, the data that needs to be processed by the "query-intensive data storage and processing system" has also shown explosive growth. However, affected by the performance of the computer running the "query-intensive data storage and processing system", the number of operations that the "query-intensive data storage and processing system" can perform on each data table in the database per unit time is limited. In order to ensure the stable operation of the "query-intensive data storage and processing system", it is necessary to ensure that the "query-intensive data storage and processing system" "average number of operations performed on the database per unit time" does not exceed its "maximum number of operations that can be performed on the database per unit time". When the "average number of operations performed on the database per unit time" of the "query-intensive data storage and processing system" is close to its "maximum number of operations performed on the database per unit time", it is necessary to upgrade the hardware configuration of the computer running the "query-intensive data storage and processing system".
[0003] Because most of the data processing and operations of the "query intensive data storage and processing system" are completed through the database, the indicator that can directly reflect the relationship between the "average number of database operations per unit time" and the "maximum number of database operations that can be performed per unit time" in the current "query intensive data storage and processing system" is the "database load" of the "query intensive data storage and processing system".
[0004] When the "database load" is closer to 1, it means that the "average number of operations performed on the database per unit time" of the current "query-intensive data storage and processing system" is closer to the "maximum number of operations that can be performed on the database per unit time".
[0005] Timely "database load" analysis for "query-intensive data storage and processing systems" can help the "query-intensive data storage and processing systems" to operate stably and long-term, ensure their good health, and avoid system crashes and slow operations due to overload, which can cause serious economic losses.
[0006] At the same time, "distributed architecture" has become increasingly popular in recent years, and more and more software systems have begun to adopt "distributed architecture". Among the "distributed architectures", "centralized distributed architecture" is particularly favored by developers.
[0007] In the "centralized distributed architecture", the supervision principle of the "task allocator node" over the "task executor node" is that if it is found that the "load rate" of a certain "task executor node" is lower than the "load rate" of other "task executor nodes", it will be arranged to execute new tasks first; if it is found that the "load rate" of a certain "task executor node" is higher than the "load rate" of other "task executor nodes", new tasks will no longer be arranged to this "node" within a certain period of time, and the "load rate" of the "task executor node" is the "database load" of each "task executor node", among which the "task executor node" can be regarded as an independent "query-intensive data storage and processing system".
[0008] It can be seen that whether the "task allocator node" can make correct decisions depends on whether it can obtain the accurate "database load" of the "task executor node". The "database load" analysis in the "task executor node" plays a vital role in the entire "distributed architecture".
[0009] The following is an explanation of the terms in the above background technology, where "data storage processing system" refers to a software system that uses a database in a computer and processes and operates the data in the database. Its main functions are to add data to the computer's database, delete data from the computer's database, modify data in the computer's database, and query and obtain data already stored in the computer's database. According to the frequency of use of each function in the "data storage processing system", it can be divided into four types of "data storage processing systems", namely "addition intensive", "deletion intensive", "modification intensive" and "query intensive". Taking "query intensive" as an example, it means that among the four main functions of a "data storage processing system", the frequency of use of the function of "querying and obtaining data already stored in the computer database" is much greater than the frequency of use of the other three functions. In the current "data storage processing system", the "addition intensive" and "query intensive" types are more common, while "deletion intensive" and "modification intensive" are relatively rare. This method is aimed at the "query intensive" "data storage processing system", namely the "query intensive data storage processing system". "Database load analysis" is simply the process of analyzing, processing and calculating the database in operation and finally obtaining the "database load rate" or "database peak load rate". "Database load rate" or "database load" or "average database load" refers to the ratio of the tasks actually carried by the current database to its task carrying capacity. In this method, it refers to the ratio of "the average number of operations performed on the database per unit time in the current system" to "the maximum number of operations that can be performed on the database per unit time in the current system", and its value is usually any number between 0 and 1. "Database peak load rate" or "database peak load" refers to the "database load rate" during the peak usage period of the system. "Data table" refers to a unit for storing data in a relational database. In a relational database (the database category mainly targeted by this method is relational database), the units for storing databases are from large to small: database, data table, record, and field. The relationship is: a database contains multiple data tables, a data table contains multiple records, and a record contains multiple fields. "Key data table" refers to a data table with representative significance in the system. The selection of key data tables should be based on the actual situation of system use. It is usually the data table with the highest direct or indirect use frequency in the database. An "index column" refers to a column in a data table of a database that has an index. Because an index is created (equivalent to a directory or dictionary in a database, which helps the computer find target data quickly), when querying the data table through the index column, the query time required is greatly shortened compared to querying the data table through non-index columns."Distributed architecture" is the application and tool of distributed computing technology. Its main manifestation is to distribute the software system originally running on one computer to polymorphic computers to complete a task together through the network. We call each computer and the software subsystem it runs a "node". The main function of "distributed architecture" is to solve the problem of insufficient performance of a single computer when processing and operating large data. It divides large data processing and operation tasks into several smaller tasks, which are jointly executed by multiple "nodes" to improve processing and operation speed. Distributed architecture is mainly divided into two types, one is centralized distributed architecture, and the other is decentralized distributed architecture. "Centralized distributed architecture" means that "nodes" are divided into two roles according to their roles, which are "task allocators" and "task executors". "Task allocators" are mainly responsible for dividing and distributing tasks and supervising "task executors". We call such "nodes" "task allocators nodes"; while "task executors" execute tasks distributed by "task allocators nodes". We call such "nodes" "task executor nodes". Each "task executor" is a "data storage and processing system". The main content of the "task allocator" supervision is whether the current workload of the "task executor" matches his work ability. Because the configuration of each "node" is different, its corresponding work ability is also different, so when supervising the "node", we cannot only judge its workload, but also make a comprehensive judgment based on its ability.
[0010] There are three main existing methods for analyzing "database load". One of them is the theoretical performance analysis method, which requires the operator to provide the computer's hardware parameters and the database version used, and then directly obtain the theoretical performance of the current computer through pure theoretical calculations and infer the "maximum number of operations that can be performed on the database per unit time in the current system". Finally, the result is compared with the "average number of operations performed on the database per unit time in the current system" to analyze the "database load" of the current system. This method often only considers the theoretical performance of the CPU, memory, and hard disk of the computer running the system, and does not consider that in actual applications, its specific performance may also be affected by the operating system version, other software usage, etc. At the same time, "the maximum number of operations that can be performed on the database per unit time in the current system" is also related to the amount of data in the current database. This analysis method does not take into account the impact of the amount of data in the database in actual application scenarios, so the "maximum number of operations that can be performed on the database per unit time in the current system" is not accurate, and even deviates from reality. Therefore, the "database load" obtained by this method is also inaccurate.
[0011] The other is the performance benchmark analysis method, which requires the operator to execute a benchmark program in the computer running the system. The test program will calculate some fixed formulas and the time required to obtain the calculation results to obtain the actual performance of the computer. According to the actual performance of the computer in the current state and the database version, the "maximum number of operations that can be performed on the database per unit time in the current system" is obtained. This method takes into account the impact of factors such as the operating system version and other software usage on computer performance, but like the theoretical performance analysis method, it does not take into account the amount of data in the current database, so the "database load" obtained by this method is also inaccurate.
[0012] The third experimental analysis method is based on the principle of running a database operation simulation script in the computer running the system. This script directly simulates the operation of the database (or its copy) of the running system, and continuously increases the average number of operations performed on the database per unit time during the running process until it is overloaded. Overload means that the time required to complete the operation required by the database in a unit time is greater than or equal to a unit time. (This situation means that the unit time is 10 seconds, and it takes 2 seconds to complete an operation, but the system requires the database to complete 6 operations every 10 seconds, which will result in one or more operations failing to be completed on time. This situation is overloaded). Record the overload critical value and use this critical value as "the maximum number of operations that can be performed on the database per unit time in the current system." Because this method directly simulates the database (or its copy) of the running system, it takes into account factors such as the actual performance of the computer in actual applications and the amount of data in the database. However, it does not take into account that in actual applications, the amount of data in the database will increase or decrease as the system runs. If the analysis results are to be accurate, it is necessary to run the simulation script regularly and update the calculation parameters. This will inevitably lead to its unsuitability for scenarios such as "distributed architecture" that require frequent analysis of the "database load". If it is to be applied to scenarios that require frequent analysis of the "database load", it will inevitably lead to a large amount of computing resources being used to run the simulation script, wasting computer performance and energy resources, and increasing costs.
[0013] Therefore, in response to the above problems, it is necessary to design a "database load" analysis method that is suitable for scenarios where "database load" needs to be analyzed frequently, which takes all factors into consideration and produces accurate analysis results. Summary of the invention
[0014] The purpose of the present invention is to solve the problem raised in the background technology, and to design a database load analysis method for a query-intensive data storage and processing system.
[0015] To achieve the above objective, the technical solution of the present invention is a database load analysis method for a query-intensive data storage processing system, the method comprising:
[0016] Step 1: Run the benchmark to get basic performance information and calculate:
[0017] Step 11: First run benchmark A to get the value of T(0) and use it as a parameter,
[0018] Step 12: Run benchmark B to obtain the value of C(2×T(0)) and record it as parameter M.
[0019] Step 13: Run the benchmark C to obtain the value of S(2×T(0),M) and record it as a parameter TN;
[0020] Step 2: Check whether the calculation of all data tables is completed. When the calculation is completed:
[0021] According to the calculation formula Or calculation Complete the calculation and output of the database average load DB-LOAD or database peak load DB-LOAD-PV;
[0022] Step 3: When calculations for all data tables are not completed, go to the next table and perform the following operations:
[0023] Step 31: Take the data table number, the number of records in the data table, the cumulative number of queries on the data table, the cumulative number of queries on the data table through the index column, and the cumulative running time of the database system and record them as i, DV, QT, QT-Index, and Time respectively.
[0024] Step 32: Substitute the parameters T(0), M and DV into Calculate the time SPQ required to complete a single query in the data table.
[0025] Step 33: Substitute the parameters SPQ and TN into the calculation formula Calculate the maximum number of queries per second for the data table SC,
[0026] Step 34: Substitute the parameters T(0) and TN into the calculation formula Calculate the maximum number of times the data table can be queried through the index column SC-Index per second;
[0027] Step 4: Determine whether to analyze the peak load;
[0028] Step 5: When not analyzing peak load, do the following:
[0029] Step 51: Substitute the parameters QT and Time into the calculation formula Calculate the average number of queries per second (QPS) during the operation of the data table.
[0030] Step 52: Substitute the parameters QT-Index and Time into the calculation formula Calculate the average number of queries per second through the index column during the operation of the data table QPS-Index,
[0031] Step 53: Substitute the parameters QPS, SC, QPS-Index, and SC-Index into the calculation formula Calculate the average load of the data table and record it as LOAD i , then execute step 3 again;
[0032] Step 6: To analyze the peak load, do the following:
[0033] Step 61: Obtain parameters: the proportion of the cumulative query times during the peak access period of the data table in the cumulative query times QT-P and the proportion of the cumulative running time during the peak access period of the database system in the cumulative running time Time-P,
[0034] Step 62: Substitute the parameters QT, QT-P, Time and Time-P into the calculation formula Calculate the average number of queries per second (QPS-PV) during the peak access period of the data table.
[0035] Step 63: Substitute the parameters QT-Index, QT-P, Time and Time-P into the calculation formula Calculate the average number of queries per second through the index column during the peak access period of the data table, QPS-Index-PV,
[0036] Step 64: Substitute the parameters QPS-PV, SC, QPS-Index-PV and SC-Index into the calculation formula Calculate the peak load for this data sheet and record it as LOAD-PV i , and then perform step 3 again.
[0037] Furthermore, the benchmark test A includes the following operations:
[0038] A1: Create a copy of the database in the current system;
[0039] A2: Clear the database copy;
[0040] A3: Query the key data tables in the database;
[0041] A4: The time required for the record query operation is T(0);
[0042] B1: Create a copy of the database in the current system;
[0043] B2: Clear the key data table in the database copy. Set n = the amount of data in the key data table in the database;
[0044] B3: Query the key data tables in the database;
[0045] B4: The time required for the record query operation is T(n);
[0046] B5: Determine whether T(n)==2×T(0±10ms is true or false;
[0047] If T(n)==2×T(0)±10ms is false, the amount of data in the key data table of the database will be increased (even if n=n+1);
[0048] If T(n)==2×T(0)±10ms is true, then M=C(2×T(0))=n;
[0049] Furthermore, the benchmark test C includes the following operations:
[0050] C1: Create a copy of the database in the current system;
[0051] C2: Clear the database copy;
[0052] C3: Increase the amount of data in the key data table in the database to M, and set the query concurrency n = 1;
[0053] C4: Concurrently query the key data tables in the database, with a concurrency number of n;
[0054] C5: Record the time required to complete all query operations, recorded as Ts(n);
[0055] C6: Determine whether Ts(n)==Ts(1)±Ts(1)×30% is true or false;
[0056] If Ts(n)==Ts(1)±Ts(1)×30% is true, increase the database query concurrency (even if n=n+1);
[0057] If Ts(n)==Ts(1)±Ts(1)×30% is false, then TN=S(2×T(0),M)=n;
[0058] Furthermore, in step 2 of the method, n is the number of data tables in the database, and the LOAD i is the data sheet load numbered i, the LOAD-PV i is the peak load of the data table numbered i.
[0059] Beneficial Effects
[0060] The present invention provides a database load analysis method for a query-intensive data storage and processing system, which has the following beneficial effects:
[0061] 1. This method combines theory with experiment when analyzing database load. It obtains system performance related data through a one-time experiment, and uses a unique calculation formula to calculate the "maximum number of operations that can be performed on the database per unit time in the current system". At the same time, it takes into account the impact of the amount of data in the current database on the calculation results through theoretical calculation, thereby ensuring the accuracy of the database analysis results.
[0062] 2. Because it has a unique calculation formula of this method, it can calculate the "maximum number of operations that can be performed on the database per unit time in the current system" and take into account the influence of the amount of data in the current database on the calculation result through theoretical calculation. Therefore, it does not need to frequently run simulation scripts in scenarios such as "distributed architecture" where "database load" needs to be analyzed frequently (in ordinary experimental methods, it is often necessary to perform simulation tests separately for databases with different amounts of data running on the same computer. For example, if there are 5 databases with data amounts of 5W, 10W, 50W, 100W, and 500W respectively, 5 tests are required. However, no matter how many databases there are, this method only needs to test 2 databases with special data amounts once as long as they run in the same computer environment, and the remaining results can be inferred from the test results), saving computer performance and energy resources and reducing operating costs.
[0063] 3. This method not only considers the impact of the amount of data in the database on the analysis results, but also considers the problem that the amount of data in each data table in the database is different. When analyzing the database load, this method analyzes each table separately and then combines the analysis results of each table to obtain the final database load. In this way, this method can also be applied to load analysis of databases with many data tables and large differences in the amount of data in the tables.
[0064] 4. This method takes into account the issue of "concurrent requests" (concurrent requests mean that the system requires multiple tasks to be performed simultaneously. For example, if the system requires task A to be executed at 20:00:00, when task A is completed, the time is 20:00:10. At this time, task B is executed. When task B is completed, the time is 20:00:20. This is a "sequential request". "Concurrent request" means that the system requires task A and task B to be executed simultaneously at 20:00:00. When both are completed, the time may also be 20:00:10. The specific time depends on the performance of the computer). Currently, common experimental methods usually use the "sequential request" method to obtain the "maximum number of operations that can be performed on the database per unit time in the current system". This method takes into account the situation of "concurrent requests" to make the obtained results more in line with the actual situation.
[0065] 5. This method also takes into account the problem of peak load, because the database load is the ratio of "the average number of operations performed on the database per unit time in the current system" to "the maximum number of operations that can be performed on the database per unit time in the current system", with the emphasis on the word "average", that is, it reflects the database load over a period of time, rather than the database load at a specific point in time. This will result in a relative database load peak during this period of time (such as an enterprise information management system, the enterprise working hours are from 9 am to 3 pm, the working hours are 6 hours, and the enterprise information management system cannot be logged in after get off work, then it can be understood that the database load peak of this enterprise information management system is these 6 hours. In this case, the calculated database load may still be normal when the system is overloaded, resulting in the system overload not being discovered in time). If a system cannot have a good user experience during the peak period, it is meaningless to have a good user experience during the time period when no one visits. Therefore, when analyzing the database load, this system takes into account the factors affecting the peak period, further improving the reference value and practical value of the analysis results.
[0066] 6. This method optimizes the analysis of "index column" query tasks when analyzing database load. If the column has an index, the time required to query the required data through the column will be greatly shortened. Therefore, this method performs load analysis on the index column query task separately. After the analysis is completed, it is summarized with the analysis results of other non-index column query tasks to obtain the final load analysis result, thereby improving the accuracy of the load analysis result. BRIEF DESCRIPTION OF THE DRAWINGS
[0067] Figure 1 It is a flow chart of the database load analysis method for a query-intensive data storage and processing system according to the present invention;
[0068] Figure 2 is a schematic diagram of the process flow of executing the benchmark test A of the present invention;
[0069] Figure 3 is a schematic diagram of the process flow of executing the benchmark test B of the present invention;
[0070] Figure 4 It is a flowchart of the execution process of the benchmark test C described in the present invention. DETAILED DESCRIPTION
[0071] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0072] See also Figure 1-4 The present invention provides a technical solution: a database load analysis method for a query-intensive data storage and processing system, the method comprising:
[0073] Step 1: Execute Benchmark A, Benchmark B, and Benchmark C to obtain basic performance information and calculate the time required to complete a query operation when the number of records in the data table is 0 (records), the number of records in the key data table when the time required to complete a query is 2×T(n) (seconds) (records M), and the maximum number of concurrent queries that can be completed on a data table with a data volume of M (records) within 2×T(0) (seconds):
[0074] Step 11: First, run benchmark A to obtain the time required to complete a query operation when the number of records in the data table is 0 (T(0)), and use it as a parameter.
[0075] Step 12: Run benchmark test B to obtain the value of C(2×T(0)), which is the number of records in the key data table when the time required to complete a query is 2×T(n) (seconds), and record it as a parameter as M.
[0076] Step 13: Run the benchmark test C to obtain the maximum number of concurrent queries that can be completed on a data table with a data volume of M (records) within 2×T(0) (seconds), that is, S(2×T(0),M), and record it as a parameter as TN;
[0077] Step 2: Check whether the calculation of all data tables is completed. When the load or peak load of all data tables in the database is obtained through calculation, the calculation of all data tables is completed. When the calculation is completed:
[0078] By using the calculation Or calculation The average load or peak load of the database is obtained by theoretical calculation. The process is to bring the average load or peak load of each data table into the calculation formula. Or calculation Complete the analysis of the average database load or the peak database load, record it as DB-LOAD or DB-LOAD-PV and output it as the analysis result,
[0079] The above process means that when the calculation of all data tables is completed, the average load of the database or the peak load of the database is calculated according to the relevant calculation formula;
[0080] Step 3: When the calculation of all data tables is not completed, that is, there are data tables that have not completed the load or peak load calculation, enter the next table and perform the following operations:
[0081] Step 31: Take the serial number of the data table, the number of records in the data table, the cumulative number of times the data table is queried, the cumulative number of times the data table is queried through the index column, and the cumulative running time of the database system as i, DV, QT, QT-Index, and Time, respectively. The serial number of the table is mainly used to identify the data table. It can be directly numbered from 1 according to the number of data tables. The specific order of the numbering does not affect the final load analysis result. The number of records in the data table, the cumulative number of times the data table is queried, the cumulative number of times the data table is queried through the index column, and the cumulative running time of the database system can be directly obtained by referring to the user manual of the database management system and using the commands provided therein.
[0082] Step 32: By using the calculation formula The time required to complete a single query in the data table is obtained by theoretical calculation. The process is to substitute the parameters T(0), M and DV obtained in the previous step into Calculate the time required to complete a single query in the data table and record it as SPQ.
[0083] Step 33: By using the calculation formula The maximum number of queries per second for the data table is obtained by theoretical calculation. The process is to substitute the parameters SPQ and TN obtained in the previous step into the calculation formula Calculate the maximum number of queries that the data table can receive per second and record it as SC.
[0084] Step 34: By using the calculation formula The maximum number of times the data table can be queried through the index column per second is obtained by theoretical calculation. The process is to substitute the parameters T(0) and TN obtained in the previous step into the calculation formula Calculate the maximum number of times the data table can be queried through the index column per second, and record it as SC-Index;
[0085] The above process means that when the calculation of all data tables is not completed, the status information of the current data table is obtained and the task carrying capacity of the data table is calculated;
[0086] Step 4: Determine whether to analyze the peak load. Whether to analyze the peak load is usually specified by the operator before the data load analysis operation begins. If the operator specifies that the peak load needs to be analyzed for this operation, the peak load is analyzed. If the operator specifies that the peak load does not need to be analyzed for this operation, the peak load is not analyzed.
[0087] Step 5: When not analyzing peak load, do the following:
[0088] Step 51: By using the formula Theoretical calculation is used to obtain the average number of queries per second during the operation of the data table. The process is to substitute the parameters QT and Time obtained in the previous step into the calculation formula Calculate the average number of queries per second during the operation of the data table and record it as QPS.
[0089] Step 52: By using the formula Theoretical calculation is performed to obtain the average number of queries per second through the index column during the operation of the data table. The process is to substitute the parameters QT-Index and Time obtained in the previous step into the calculation formula Calculate the average number of queries per second through the index column during the operation of the data table, and record it as QPS-Index.
[0090] Step 53: By using the calculation formula The average load of the data table is obtained by theoretical calculation. The process is to put the parameters QPS, SC, QPS-Index, and SC-Index obtained in the previous steps into the calculation formula Calculate the average load of the data table and record it as LOAD i ;
[0091] The above process means that when the peak load is not analyzed, the tasks actually carried by the current data table are obtained and the average load of the data table is calculated;
[0092] Then execute step 3 again;
[0093] Step 6: To analyze the peak load, do the following:
[0094] Step 61: Obtain the parameters manually set by the operator according to the actual situation of the system operation: the proportion of the cumulative query times during the peak access period of the data table in the cumulative query times QT-P and the proportion of the cumulative running time during the peak access period of the database system in the cumulative running time Time-P,
[0095] Step 62: By using the calculation formula Theoretical calculation is performed to obtain the average number of queries per second during the peak access period of the data table. The process is to substitute the parameters QT, QT-P, Time and Time-P obtained in the previous steps into the calculation formula Calculate the average number of queries per second during the peak access period for the data table and record it as QPS-PV.
[0096] Step 63: By using the formula Theoretical calculation is performed to obtain the average number of queries per second through the index column during the peak access period of the data table. The process is to bring the parameters QT-Index, QT-P, Time and Time-P obtained in the previous steps into the calculation formula Calculate the average number of queries per second through the index column during the peak access period of the data table, and record it as QPS-Index-PV.
[0097] Step 64: By using the calculation formula The peak load of the data table is obtained by theoretical calculation. The process is to put the parameters QPS-PV, SC, QPS-Index-PV and SC-Index obtained in the previous steps into the calculation formula Calculate the peak load for this data sheet and record it as LOAD-PV i ;
[0098] The above process means that when analyzing the peak load, the tasks carried during the peak access period of the current data table are obtained, and the peak load of the table is calculated;
[0099] Then perform step 3 again.
[0100] In the present invention, the benchmark test A includes the following operations:
[0101] A1: Create a copy of the database in the current system, that is, use database commands or database management system to copy the database in use in the system;
[0102] A2: Clear the database copy, that is, delete the data in all data tables in the database copy through commands or the database management system;
[0103] A3: Select the most frequently used data table in the database as the key data table, and perform a query operation on the key data table in the database, that is, query through commands or database management system. In order to ensure the accuracy of the analysis results, you should only use commands or database management system to query during the whole process;
[0104] A4: The time required for the record query operation is T(0);
[0105] In the present invention, the benchmark test B includes the following operations:
[0106] B1: Create a copy of the database in the current system, that is, use database commands or database management system to copy the database currently in use in the system;
[0107] B2: Clear the key data table in the database copy, and set n to be the amount of data in the key data table in the database, with its initial value being 0;
[0108] B3: Select the most frequently used data table in the database as the key data table, and perform a query operation on the key data table in the database, that is, query through commands or database management system. In order to ensure the accuracy of the analysis results, only commands or database management system should be used for query in the whole process;
[0109] B4: The time required for the record query operation is T(n);
[0110] B5: Determine whether T(n)==2×T(0±10ms is true or false;
[0111] If T(n)==2×T(0)±10ms is false, the amount of data in the key data table of the database is increased (even if n=n+1), and then operation B3 is performed again;
[0112] If T(n)==2×T(0)±10ms is true, then M=C(2×T(0))=n;
[0113] In the present invention, the benchmark test C includes the following operations:
[0114] C1: Create a copy of the database in the current system, that is, use database commands or database management system to copy the database currently in use in the system;
[0115] C2: Clear the database copy;
[0116] C3: By writing random data generated according to actual data into the key data table, the data volume of the key data table in the database is increased to M, and n is set as the query concurrency, and its initial value is 1;
[0117] C4: Use the test tool provided by the database system (such as the MysqlSlap tool in the Mysql database system) to perform concurrent queries on the key data tables in the database, with a concurrent query number of n;
[0118] C5: Wait for all concurrent query tasks to be completed, refer to the test results in the test tool provided by the database system, and record the time required for the task to be completed, which is recorded as Ts(n);
[0119] C6: Determine whether Ts(n)==Ts(1)±Ts(1)×30% is true or false;
[0120] If Ts(n)==Ts(1)±Ts(1)×30% is true, increase the database query concurrency (even if n=n+1), and then execute operation C4 again;
[0121] If Ts(n)==Ts(1)±Ts(1)×30% is false, then TN=S(2×T(0),M)=n;
[0122] In step 2 of the method of the present invention, n is the number of data tables in the database, and LOAD i is the data sheet load numbered i, the LOAD-PV i is the peak load of the data table numbered i.
[0123] In the present invention, the meaning of the parameters mentioned are as follows:
[0124]
[0125]
[0126] In the present invention, the "maximum number of times a data table can be queried per second" mentioned is essentially a reflection of computer performance. For example, when the "maximum number of times a data table can be queried per second" is 5 times / second, it means that when the "average number of times the data table is queried per second during operation" is 5 times / second, the tasks executed by the table will completely occupy the computer's performance; for example, when the "maximum number of times a data table can be queried per second" is 5 times / second, it means that when the "average number of times the data table is queried per second during operation" is 4 times / second, the tasks executed by the table will occupy 80% of the computer's performance. The sum of the average load or peak load of all data tables in the database is the ratio of the computer's performance occupied by the tasks executed by the database.
[0127] In the present invention, the basic function explanation is mentioned:
[0128]
[0129]
[0130] In the present invention, the method for obtaining parameters is mentioned:
[0131]
[0132]
[0133] In the present invention, in order to prove the accuracy of the analysis results, in actual operation The experiment is conducted by using a calculation formula, which is a unique and key step in this database load analysis method. Its purpose is to obtain the parameter "the time required to complete a single query in the data table" in the database, and its result directly affects the result of the database load analysis.
[0134] The experimental results are shown in the following table:
[0135]
[0136] If this parameter is obtained through actual testing, then each time the amount of data in the database changes, it needs to be retested, which will result in a large amount of computing resources being wasted on testing. The present invention solves this technical problem.
[0137] It should be noted that, in this article, relational terms such as first and second, etc. 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 sentence "includes an element defined by ... does not exclude the existence of other identical elements in the process, method, article or device including the element".
[0138] Although embodiments of the present invention have been shown and described, it will be appreciated by those skilled in the art that various changes, modifications, substitutions and variations may be made to the embodiments without departing from the principles and spirit of the present invention, and that the scope of the present invention is defined by the appended claims and their equivalents.
Claims
1. A database load analysis method for a query-intensive data storage and processing system, characterized in that: The method comprises: Step 1: Run the benchmark to get basic performance information and calculate: Step 11: First run benchmark A to get the value of T(0) and use it as a parameter, Step 12: Run benchmark B to obtain the value of C(2×T(0)) and record it as parameter M. Step 13: Run the benchmark test C to obtain the value of S(2×T(0), M) and record it as a parameter TN; Step 2: Check whether the calculation of all data tables is completed. When the calculation is completed: According to the calculation formula Or calculation Complete the calculation of the database average load DB-LOAD or the database peak load DB-LOAD-PV and output it as the analysis result; Step 3: When calculations for all data tables are not completed, go to the next data table and perform the following operations: Step 31: Take the data table number, the number of records in the data table, the cumulative number of queries on the data table, the cumulative number of queries on the data table through the index column, and the cumulative running time of the database system and record them as i, DV, QT, QT-Index, and Time respectively. Step 32: Substitute the parameters T(0), M and DV into Calculate the time SPQ required to complete a single query in the data table. Step 33: Substitute the parameters SPQ and TN into the calculation formula Calculate the maximum number of queries per second for the data table SC, Step 34: Substitute the parameters T(0) and TN into the calculation formula Calculate the maximum number of times the data table can be queried through the index column SC-Index per second; Step 4: Determine whether to analyze the peak load; Step 5: When not analyzing peak load, do the following: Step 51: Substitute the parameters QT and Time into the calculation formula Calculate the average number of queries per second (QPS) during the operation of the data table. Step 52: Substitute the parameters QT-Index and Time into the calculation formula Calculate the average number of queries per second through the index column during the operation of the data table QPS-Index, Step 53: Substitute the parameters QPS, SC, QPS-Index, and SC-Index into the calculation formula Calculate the average load of the data table and record it as LOADi, then execute step 3 again; Step 6: To analyze peak load, do the following: Step 61: Obtain parameters: the proportion of the cumulative query times during the peak access period of the data table in the cumulative query times QT-P and the proportion of the cumulative running time during the peak access period of the database system in the cumulative running time Time-P, Step 62: Substitute the parameters QT, QT-P, Time and Time-P into the calculation formula Calculate the average number of queries per second (QPS-PV) during the peak access period of the data table. Step 63: Substitute the parameters QT-Index, QT-P, Time and Time-P into the calculation formula Calculate the average number of queries per second through the index column during the peak access period of the data table, QPS-Index-PV, Step 64: Substitute the parameters QPS-PV, SC, QPS-Index-PV and SC-Index into the calculation formula Calculate the peak load of the data table and record it as LOAD-PVi, then execute step 3 again; The benchmark test A includes the operations: A1: Create a copy of the database in the current system; A2: Clear the database copy; A3: Query the key data tables in the database. A4: The time required for the record query operation is T(0); The benchmark test B includes the operations: B1: Create a copy of the database in the current system; B2: Clear the key data table in the database copy. Set n = the amount of data in the key data table in the database; B3: Query the key data tables in the database; B4: The time required for the record query operation is T(n); B5: Determine whether T(n)==2×T(0±10ms is true or false; If T(n)==2×T(0)±10ms is false, the amount of data in the key data table of the database will be increased; If T(n)==2×T(0)±10ms is true, then M=C(2×T(0))=n; The benchmark C includes the following operations: C1: Create a copy of the database in the current system; C2: Clear the database copy; C3: Increase the amount of data in the key data table in the database to M, and set the query concurrency n = 1; C4: Concurrently query the key data tables in the database, with a concurrency number of n; C5: Record the time required to complete all query operations, recorded as Ts(n); C6: Determine whether Ts(n)==Ts(1)±Ts(1)×30% is true or false; If Ts(n)==Ts(1)±Ts(1)×30% is true, increase the database query concurrency; If Ts(n)==Ts(1)±Ts(1)×30% is false, then TN=S(2×T(0), M)=n; The n is the number of data tables in the database, the LOADi is the load of the data table numbered i, and the LOAD-PVi is the peak load of the data table numbered i.
