CN110543418B - Database performance test method, system and storage medium - Google Patents
Database performance test method, system and storage medium Download PDFInfo
- Publication number
- CN110543418B CN110543418B CN201910781354.7A CN201910781354A CN110543418B CN 110543418 B CN110543418 B CN 110543418B CN 201910781354 A CN201910781354 A CN 201910781354A CN 110543418 B CN110543418 B CN 110543418B
- Authority
- CN
- China
- Prior art keywords
- database
- test
- testing
- data
- monitoring
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 37
- 238000011056 performance test Methods 0.000 title description 9
- 238000012360 testing method Methods 0.000 claims abstract description 192
- 238000012544 monitoring process Methods 0.000 claims abstract description 37
- 238000002360 preparation method Methods 0.000 claims description 8
- 238000005457 optimization Methods 0.000 claims description 5
- 238000004590 computer program Methods 0.000 description 6
- 238000006467 substitution reaction Methods 0.000 description 3
- 230000007547 defect Effects 0.000 description 2
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 238000010998 test method Methods 0.000 description 2
- 238000012356 Product development Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000012423 maintenance Methods 0.000 description 1
- 230000003252 repetitive effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3684—Test management for test design, e.g. generating new test cases
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3688—Test management for test execution, e.g. scheduling of test suites
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Preventing errors by testing or debugging software
- G06F11/3668—Software testing
- G06F11/3672—Test management
- G06F11/3692—Test management for test results analysis
Abstract
The invention relates to a method, a system and a storage medium for testing database performance, which comprises the following steps: s1: preparing a test database and data for the test database; s2: testing a database to be tested, running test sentences in parallel to test the database to be tested, testing each test sentence for multiple times, and finely adjusting input parameters of the current test sentence during each running; s3: monitoring a test result, monitoring and collecting data in the test process in the running process of the test statement, and detecting whether each index of the database meets an expected set condition or not according to the collected monitoring data in the test process; s4: and adjusting and optimizing the configuration of the database according to the test result, and adjusting and optimizing the configuration of the database indexes which do not meet the expected set conditions.
Description
Technical Field
The invention belongs to the field of operation and maintenance of a Linux operating system, relates to a database test scheme under the Linux system, and particularly relates to a database performance test method, a database performance test system and a storage medium.
Background
Linux is an open-source, free and powerful operating system, is liked by countless IT practitioners at home and abroad, and is the first choice of the server operating systems of most software enterprises and companies.
MySQL is a relational database management system that keeps data in different tables instead of putting all the data in one large repository, which increases speed and flexibility.
For the mysql database of the linux operating system, the domestic utilization rate is very high, for product development testers, the performance test of the database is particularly important, the market competitiveness of products is directly influenced, and under the current environment, the performance test tools of windows-version databases are infinite, such as Jmeter and the like, but the database test tools of linux are quite rare, and the commonly used test method of the test databases is manual test, so that the efficiency is low, and the test result is inaccurate; this is a drawback and deficiency in the prior art.
In view of the above, the present invention provides a method, system and storage medium for testing database performance; to solve the defects and shortcomings in the prior art.
Disclosure of Invention
Aiming at the problems of low efficiency and inaccurate test result of manual database test in the prior art, the invention provides a database performance test method, a database performance test system and a storage medium, so as to solve the technical defects.
In order to achieve the purpose, the invention provides the following technical scheme:
in a first aspect:
the invention provides a database performance testing method, which comprises the following steps:
s1: preparing a test database and data for the test database;
starting a test database and enabling the test database to normally operate, and preparing perfect test data for the test database; calling a database interface, and establishing a connection relation between the test system platform and the database to be tested;
s2: testing a database to be tested, running test sentences in parallel to test the database to be tested, testing each test sentence for multiple times, and finely adjusting input parameters of the current test sentence during each running;
s3: monitoring a test result, monitoring and collecting data in the test process in the running process of the test statement, and detecting whether each index of the database meets an expected set condition or not according to the collected monitoring data in the test process;
s4: and adjusting and optimizing the configuration of the database according to the test result, and adjusting and optimizing the configuration of the database indexes which do not accord with the expected set conditions.
As another preferred embodiment of the present invention, the step S1 specifically includes the following steps:
s1.1: opening and operating a database;
s1.2: initializing a database, preparing perfect test data according to needs, and loading the perfect test data into a database memory.
If the test of the database contains specific services, specific service data needs to be prepared; if the testing of the database involves only the database itself, only the test data associated with the database need be prepared. Only if a sufficient amount of test data is provided, the running test statements can test the true performance of the database and the hardware configuration of the machine device can support the running pressure of the database.
As another preferred embodiment of the present invention, in step S3, monitoring data of the physical resource usage rate, the database monitoring performance, and the slow sql query are collected by running corresponding test statements, and it is determined whether each of the indexes meets an expected setting condition.
As another preferable preference of the technical solution, in the step S4, only a single index which does not meet the expected setting condition is subjected to corresponding optimal configuration each time, and after the optimal configuration is adjusted, the test is continued for the index until the index meets the expected setting condition, and then the next index which does not meet the expected setting condition is subjected to optimal configuration. Indexes which do not accord with expected set conditions are optimized item by item, and the confusion of index optimization configuration is avoided; and the optimal configuration quality is improved.
In a second aspect:
the invention provides a database performance test system, comprising:
the database and test data preparation module is used for starting the test database and enabling the test database to normally operate and preparing perfect test data for the test database; calling a database interface, and establishing a connection relation between the test system platform and the database to be tested;
the database testing module is used for testing the database to be tested by parallelly operating the testing sentences, each testing sentence is tested for multiple times, and the input parameters of the current testing sentence are finely adjusted during each operation;
the monitoring test result module is used for monitoring and collecting data in the test process in the test statement operation process and detecting whether each index of the database meets the expected set condition or not according to the monitoring data collected in the test process;
and the optimized database configuration module is used for adjusting and optimizing the configuration of the database indexes which do not accord with the expected set conditions.
As another preferred aspect of the present invention, the database and test data preparation module includes: and starting and operating the database unit and initializing the database unit, preparing perfect test data according to needs, and loading the perfect test data into a database memory.
If the test of the database contains specific services, specific service data needs to be prepared; if the testing of the database involves only the database itself, only test data relating to the database need be prepared. Only if a sufficient amount of test data is provided, the running test statements can test the true performance of the database and the hardware configuration of the machine device can support the running pressure of the database.
As another preferred embodiment of the present technical solution, in the monitoring test result module, monitoring data of physical resource utilization rate, database monitoring performance, and slow sql query are collected by running corresponding test statements, and whether each index meets an expected set condition is determined.
As another preferable mode of the technical solution, in the optimized database configuration module, only a single index that does not meet the expected setting condition is subjected to corresponding optimized configuration each time, and after the optimized configuration is adjusted, the test is continued for the index until the index meets the expected setting condition, and then the next index that does not meet the expected setting condition is subjected to optimized configuration. Indexes which do not accord with expected set conditions are optimized item by item, and the confusion of index optimization configuration is avoided; and the optimal configuration quality is improved.
In a third aspect:
the present invention provides a computer storage medium having stored therein instructions that, when run on a computer, cause the computer to perform the method of the first aspect.
A fourth aspect;
the present invention provides a terminal, including:
a processor, a memory, wherein,
the memory is used for storing a computer program which,
the processor is configured to retrieve from the memory and execute the computer program, so that the terminal performs the method of the first aspect.
A fifth aspect;
the present invention provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of the first aspect.
The method has the advantages that complicated test work is combed, the database pressure test can be efficiently carried out by operating the test method on any server, and the required performance index can be rapidly and clearly obtained. A large amount of complicated manual operation and repetitive operation which are difficult to be carried out simultaneously are saved, and the testing efficiency is greatly improved.
In addition, the invention has reliable design principle, simple structure and very wide application prospect.
Drawings
In order to more clearly illustrate the embodiments or technical solutions in the prior art of the present invention, the drawings used in the description of the embodiments or prior art will be briefly described below, and it is obvious for those skilled in the art that other drawings can be obtained based on these drawings without creative efforts.
FIG. 1 is a flow chart of a database performance testing method provided by the present invention.
FIG. 2 is a schematic block diagram of a database performance testing system according to the present invention.
The system comprises a database and test data preparation module, a database test module, a monitoring test result module and an optimization database configuration module, wherein the database and test data preparation module is 1, the database test module is 2, the monitoring test result module is 3, and the optimization database configuration module is 4.
Detailed Description
In order to make those skilled in the art better understand the technical solutions of the present invention, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
Example 1:
as shown in fig. 1, this embodiment provides a database performance testing method, which includes the following steps:
s1: preparing a test database and data for the test database;
starting a test database and enabling the test database to normally operate, and preparing complete test data for the test database; a database interface is called, and a connection relation is established between the test system platform and the database to be tested;
the step S1 specifically includes the steps of:
s1.1: opening and operating a database;
s1.2: initializing a database, preparing perfect test data according to needs, and loading the perfect test data into a database memory.
If the test of the database contains specific services, specific service data needs to be prepared; if the testing of the database involves only the database itself, only test data relating to the database need be prepared. Only if a sufficient amount of test data is provided, the running test statements can test the true performance of the database and the hardware configuration of the machine device can support the running pressure of the database.
S2: testing a database to be tested, running test sentences in parallel to test the database to be tested, testing each test sentence for multiple times, and finely adjusting input parameters of the current test sentence during each running;
s3: monitoring a test result, monitoring and collecting data in the test process in the running process of the test statement, and detecting whether each index of the database meets an expected set condition or not according to the collected monitoring data in the test process;
and collecting monitoring data of the physical resource utilization rate, the database monitoring performance and the slow sql query by operating corresponding test statements, and judging whether the indexes meet the expected set conditions.
S4: adjusting and optimizing the configuration of the database according to the test result, and adjusting and optimizing the configuration of the database indexes which do not meet the expected set conditions;
only carrying out corresponding optimized configuration on a single index which does not accord with the expected setting condition each time, and continuously testing the index after adjusting the optimized configuration until the index accords with the expected setting condition, and then carrying out optimized configuration on the next index which does not accord with the expected setting condition.
Example 2:
as shown in fig. 2, the present embodiment provides a database performance testing system, which includes:
the database and test data preparation module 1 is used for starting a test database and enabling the test database to normally operate, and preparing complete test data for the test database; a database interface is called, and a connection relation is established between the test system platform and the database to be tested;
the database and test data preparation module comprises: and starting and operating the database unit and initializing the database unit, preparing perfect test data according to needs, and loading the perfect test data into a database memory.
If the test of the database contains specific services, specific service data needs to be prepared; if the testing of the database involves only the database itself, only test data relating to the database need be prepared. Only if a sufficient amount of test data is provided, the running test statements can test the true performance of the database and the hardware configuration of the machine device can support the running pressure of the database.
The database test module 2 is used for testing the database to be tested by parallelly operating the test sentences, each test sentence is tested for multiple times, and the input parameters of the current test sentence are finely adjusted during each operation;
the monitoring test result module 3 is used for monitoring and collecting data in the test process in the test statement operation process and detecting whether each index of the database meets the expected set condition or not according to the monitoring data collected in the test process;
and collecting monitoring data of the physical resource utilization rate, the database monitoring performance and the slow sql query by operating corresponding test statements, and judging whether the indexes meet the expected set conditions.
The optimized database configuration module 4 is used for adjusting, optimizing and configuring the database indexes which do not meet the expected set conditions;
only carrying out corresponding optimized configuration on a single index which does not accord with the expected setting condition each time, and continuously testing the index after adjusting the optimized configuration until the index accords with the expected setting condition, and then carrying out optimized configuration on the next index which does not accord with the expected setting condition.
Example 3:
the present embodiment provides a computer storage medium having stored therein instructions that, when run on a computer, cause the computer to perform the method of embodiment 1.
Example 4:
the present embodiment provides a terminal, including:
a processor, a memory, wherein,
the memory is used for storing a computer program which,
the processor is adapted to call and run the computer program from the memory so that the terminal performs the method of embodiment 1.
Example 5:
the present invention provides a computer program product comprising instructions which, when run on a computer, cause the computer to perform the method of embodiment 1.
Although the present invention has been described in detail in connection with the preferred embodiments with reference to the accompanying drawings, the present invention is not limited thereto. Various equivalent modifications or substitutions can be made on the embodiments of the present invention by those skilled in the art without departing from the spirit and scope of the present invention, and these modifications or substitutions are within the scope of the present invention/any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present invention. Therefore, the protection scope of the present invention shall be subject to the protection scope of the claims.
Claims (7)
1. A database performance testing method is characterized by comprising the following steps:
s1: preparing a test database and data for the test database;
starting a test database and enabling the test database to normally operate, and preparing complete test data for the test database; a database interface is called, and a connection relation is established between the test system platform and the database to be tested;
s2: testing a database to be tested, running test sentences in parallel to test the database to be tested, testing each test sentence for multiple times, and finely adjusting input parameters of the current test sentence during each running;
s3: monitoring a test result, monitoring and collecting data in the test process in the running process of the test statement, and detecting whether each index of the database meets an expected set condition or not according to the monitoring data collected in the test process;
s4: adjusting and optimizing the configuration of the database according to the test result, and performing adjustment and optimization configuration processing on the database indexes which do not meet the expected set conditions;
in the step S4, only a single index which does not meet the expected setting condition is subjected to corresponding optimal configuration each time, and after the optimal configuration is adjusted, the test is continued for the index until the index meets the expected setting condition, and then the next index which does not meet the expected setting condition is subjected to optimal configuration.
2. The method for testing the performance of the database according to claim 1, wherein the step S1 specifically comprises the following steps:
s1.1: opening and operating a database;
s1.2: initializing a database, preparing perfect test data according to needs, and loading the perfect test data into a database memory.
3. The method for testing the performance of the database according to claim 2, wherein in step S3, the monitoring data of the physical resource utilization rate, the database monitoring performance and the slow sql query are collected by running corresponding test statements, and whether each index meets an expected set condition is judged.
4. A database performance testing system, comprising:
the database and test data preparation module is used for starting the test database and enabling the test database to normally operate and preparing perfect test data for the test database; calling a database interface, and establishing a connection relation between the test system platform and the database to be tested;
the database testing module is used for testing the database to be tested by parallelly operating the testing sentences, each testing sentence is tested for multiple times, and the input parameters of the current testing sentence are finely adjusted during each operation;
the monitoring test result module is used for monitoring and collecting data in the test process in the test statement operation process and detecting whether each index of the database meets the expected set condition or not according to the monitoring data collected in the test process;
the optimized database configuration module is used for adjusting and optimizing configuration processing on database indexes which do not meet expected set conditions;
in the optimized database configuration module, only a single index which does not accord with the expected setting condition is subjected to corresponding optimized configuration each time, the optimized configuration is adjusted, then the test is continued aiming at the index until the index accords with the expected setting condition, and then the next index which does not accord with the expected setting condition is subjected to optimized configuration.
5. The system of claim 4, wherein the database and test data preparation module comprises: and starting and operating the database unit and initializing the database unit, preparing perfect test data according to needs, and loading the perfect test data into a database memory.
6. The system according to claim 5, wherein in the monitoring test result module, monitoring data of physical resource utilization rate, database monitoring performance and slow sql query are collected by running corresponding test statements, and whether each index meets an expected set condition is judged.
7. A computer storage medium having stored therein instructions that, when executed on a computer, cause the computer to perform the method of any one of claims 1-3.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910781354.7A CN110543418B (en) | 2019-08-23 | 2019-08-23 | Database performance test method, system and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910781354.7A CN110543418B (en) | 2019-08-23 | 2019-08-23 | Database performance test method, system and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110543418A CN110543418A (en) | 2019-12-06 |
CN110543418B true CN110543418B (en) | 2023-01-10 |
Family
ID=68711990
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910781354.7A Active CN110543418B (en) | 2019-08-23 | 2019-08-23 | Database performance test method, system and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110543418B (en) |
Families Citing this family (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN112115029A (en) * | 2020-09-28 | 2020-12-22 | 中国银行股份有限公司 | Performance test method and device, computer equipment and computer readable storage medium |
CN112231236A (en) * | 2020-12-14 | 2021-01-15 | 广东睿江云计算股份有限公司 | Method for testing database performance |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105224458A (en) * | 2015-10-09 | 2016-01-06 | 上海瀚银信息技术有限公司 | A kind of database method of testing and system |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US20060085484A1 (en) * | 2004-10-15 | 2006-04-20 | Microsoft Corporation | Database tuning advisor |
-
2019
- 2019-08-23 CN CN201910781354.7A patent/CN110543418B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105224458A (en) * | 2015-10-09 | 2016-01-06 | 上海瀚银信息技术有限公司 | A kind of database method of testing and system |
Non-Patent Citations (2)
Title |
---|
数据库性能评测指标及其测试方法研究;李征宇等;《电子设计工程》;20110220(第04期);全文 * |
浅谈我院SQL Server数据库的压力测试;祁星等;《江苏卫生事业管理》;20160628(第03期);全文 * |
Also Published As
Publication number | Publication date |
---|---|
CN110543418A (en) | 2019-12-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110069572B (en) | HIVE task scheduling method, device, equipment and storage medium based on big data platform | |
CN107016019B (en) | Database index creation method and device | |
CN110543418B (en) | Database performance test method, system and storage medium | |
CN108512716B (en) | Method, system, computer device and storage medium for reporting device information | |
US11893011B1 (en) | Data query method and system, heterogeneous acceleration platform, and storage medium | |
CN104503880A (en) | Method and device for realizing MySQL database monitoring option script | |
CN105224458A (en) | A kind of database method of testing and system | |
CN109871368B (en) | Database detection method, database detection device, computer device and storage medium | |
CN104778185A (en) | Determination method for abnormal SQL (structured query language) statement and server | |
CN111241059A (en) | Database optimization method and device based on database | |
CN110399377A (en) | Optimization method, device, electronic equipment and the computer readable storage medium of SQL | |
CN112579603A (en) | CDC-based data model dynamic information perception monitoring method and device | |
CN110377519B (en) | Performance capacity test method, device and equipment of big data system and storage medium | |
CN114265857A (en) | Query statement processing method and device | |
CN107273293B (en) | Big data system performance test method and device and electronic equipment | |
CN108255704B (en) | Abnormal response method of script calling event and terminal thereof | |
CN115993808A (en) | System and method for diagnosing energy consumption of gas steam boiler | |
CN115455091A (en) | Data generation method and device, electronic equipment and storage medium | |
CN113190543A (en) | Data cleaning method and device, electronic equipment and storage medium | |
CN114138578B (en) | Server testing method and device | |
CN116820692A (en) | Distributed computing method and system based on pandas interface | |
CN114116677A (en) | Data processing method, device, storage medium and equipment based on multiple data sources | |
CN111221821B (en) | AI model iterative updating method, electronic equipment and storage medium | |
CN110389868B (en) | Method and system for optimizing complete machine diagnosis process of server manufacturing factory | |
CN117370158A (en) | Test processing method, system, electronic equipment and medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |