CN110543418A - database performance test method, system and storage medium - Google Patents

database performance test method, system and storage medium Download PDF

Info

Publication number
CN110543418A
CN110543418A CN201910781354.7A CN201910781354A CN110543418A CN 110543418 A CN110543418 A CN 110543418A CN 201910781354 A CN201910781354 A CN 201910781354A CN 110543418 A CN110543418 A CN 110543418A
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.)
Granted
Application number
CN201910781354.7A
Other languages
Chinese (zh)
Other versions
CN110543418B (en
Inventor
张源
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Suzhou Wave Intelligent Technology Co Ltd
Original Assignee
Suzhou Wave Intelligent Technology Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Suzhou Wave Intelligent Technology Co Ltd filed Critical Suzhou Wave Intelligent Technology Co Ltd
Priority to CN201910781354.7A priority Critical patent/CN110543418B/en
Publication of CN110543418A publication Critical patent/CN110543418A/en
Application granted granted Critical
Publication of CN110543418B publication Critical patent/CN110543418B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3684Test management for test design, e.g. generating new test cases
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3692Test management for test results analysis

Landscapes

  • Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Debugging And Monitoring (AREA)
  • Information Retrieval, Db Structures And Fs Structures Therefor (AREA)

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

database performance test method, system and storage medium
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 utilization rate in China 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 database are infinite, such as Jmeter and the like, but the database test tools of linux are quite rare, and the commonly used test database test method 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 complete 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 meet 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 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 preferable mode of the present technical solution, in step S3, the monitoring data of the physical resource usage rate, the database monitoring performance, and the slow sql query are collected by running the corresponding test statements, and it is determined whether each of the indexes meets the expected setting condition.
as another preferable mode of the present invention, in step S4, only a single index that does not meet the expected setting condition is optimized and configured, and after the optimized configuration is adjusted, the test is continued for the index until the expected setting condition is met, and then the next index that does not meet the expected setting condition is optimized and configured. Optimizing and configuring indexes which do not meet expected set conditions item by item, and avoiding the confusion of index optimization configuration; 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 run, and preparing the complete 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 collected monitoring data in the test process;
and the optimized database configuration module is used for adjusting and optimizing configuration of the database indexes which do not meet 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 invention, in the monitoring test result module, monitoring data of physical resource usage rate, database monitoring performance, and slow sql query are collected by running corresponding test statements, and whether each of the above indexes meets an expected setting 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. Optimizing and configuring indexes which do not meet expected set conditions item by item, and avoiding the confusion of index optimization configuration; 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 adapted to retrieve and execute the computer program from the memory so that the terminal performs the method according to 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 solution of the present invention, the technical solution in the embodiment of the present invention will be clearly and completely described below with reference to the drawings in the embodiment of the present invention, and it is obvious that the described embodiment is only a part of the embodiment of the present invention, and not all 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; calling a database interface, and establishing a connection relation 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 performing adjustment and optimization configuration processing on 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, this 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; calling a database interface, and establishing a connection relation 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 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.
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 by referring to the drawings in connection with the preferred embodiments, 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 (9)

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; 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 meet the expected set conditions.
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 database performance according to claim 2, wherein in step S3, monitoring data of physical resource usage rate, database monitoring performance, and slow sql query are collected by running corresponding test statements, and whether each index meets an expected setting condition is determined.
4. The method according to claim 3, wherein in step S4, only a single index that does not meet the predetermined setting condition is optimized and configured each time, and after the optimized configuration is adjusted, the test is continued for the index until the predetermined setting condition is met, and then the next index that does not meet the predetermined setting condition is optimized and configured.
5. 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 run, and preparing the complete 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 collected monitoring data in the test process;
and the optimized database configuration module is used for adjusting and optimizing configuration of the database indexes which do not meet the expected set conditions.
6. the system of claim 5, 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.
7. the system according to claim 6, 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.
8. the system according to claim 7, wherein in the optimized database configuration module, only a single index that does not meet the expected setting condition is optimized and configured each time, and the test is continued for the index after the optimized configuration is adjusted until the index meets the expected setting condition, and then the next index that does not meet the expected setting condition is optimized and configured.
9. 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-4.
CN201910781354.7A 2019-08-23 2019-08-23 Database performance test method, system and storage medium Active CN110543418B (en)

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 true CN110543418A (en) 2019-12-06
CN110543418B 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)

Cited By (2)

* Cited by examiner, † Cited by third party
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 (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060085484A1 (en) * 2004-10-15 2006-04-20 Microsoft Corporation Database tuning advisor
CN105224458A (en) * 2015-10-09 2016-01-06 上海瀚银信息技术有限公司 A kind of database method of testing and system

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20060085484A1 (en) * 2004-10-15 2006-04-20 Microsoft Corporation Database tuning advisor
CN105224458A (en) * 2015-10-09 2016-01-06 上海瀚银信息技术有限公司 A kind of database method of testing and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
李征宇等: "数据库性能评测指标及其测试方法研究", 《电子设计工程》 *
祁星等: "浅谈我院SQL Server数据库的压力测试", 《江苏卫生事业管理》 *

Cited By (2)

* Cited by examiner, † Cited by third party
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

Also Published As

Publication number Publication date
CN110543418B (en) 2023-01-10

Similar Documents

Publication Publication Date Title
CN110069572B (en) HIVE task scheduling method, device, equipment and storage medium based on big data platform
CN109871368B (en) Database detection method, database detection device, computer device and storage medium
CN108512716B (en) Method, system, computer device and storage medium for reporting device information
CN110543418B (en) Database performance test method, system and storage medium
CN105224458A (en) A kind of database method of testing and system
CN111241059B (en) Database optimization method and device based on database
CN104778185A (en) Determination method for abnormal SQL (structured query language) statement and server
CN113360722A (en) Fault root cause positioning method and system based on multidimensional data map
WO2019148657A1 (en) Method for testing associated environments, electronic device and computer readable storage medium
CN110377519B (en) Performance capacity test method, device and equipment of big data system and storage medium
CN115034512A (en) Process optimization method, system, equipment and computer readable storage medium
CN114265857A (en) Query statement processing method and device
CN107273293B (en) Big data system performance test method and device and electronic equipment
CN111124805A (en) Data acquisition method, device, equipment and storage medium
CN108255704B (en) Abnormal response method of script calling event and terminal thereof
CN115525392A (en) Container monitoring method and device, electronic equipment and storage medium
CN113190543A (en) Data cleaning method and device, electronic equipment and storage medium
CN111752916B (en) Data acquisition method and device, computer readable storage medium and electronic equipment
CN114238395A (en) Database optimization method and device, electronic equipment and storage medium
CN114138578B (en) Server testing method and device
WO2023103627A1 (en) Network inspection method and apparatus, electronic device and storage medium
CN114116677A (en) Data processing method, device, storage medium and equipment based on multiple data sources
CN116820692A (en) Distributed computing method and system based on pandas interface
CN117472751A (en) Vehicle system function analysis method, device, equipment and medium
CN114238979A (en) Vulnerability detection method, device, equipment and computer readable storage 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