CN111488271B - Message middleware tuning method, system, electronic equipment and storage medium - Google Patents

Message middleware tuning method, system, electronic equipment and storage medium Download PDF

Info

Publication number
CN111488271B
CN111488271B CN202010161748.5A CN202010161748A CN111488271B CN 111488271 B CN111488271 B CN 111488271B CN 202010161748 A CN202010161748 A CN 202010161748A CN 111488271 B CN111488271 B CN 111488271B
Authority
CN
China
Prior art keywords
test
performance
index
middleware
tuning
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
Application number
CN202010161748.5A
Other languages
Chinese (zh)
Other versions
CN111488271A (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.)
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information Technology Co Ltd
Original Assignee
China Mobile Communications Group Co Ltd
China Mobile Hangzhou Information 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 China Mobile Communications Group Co Ltd, China Mobile Hangzhou Information Technology Co Ltd filed Critical China Mobile Communications Group Co Ltd
Priority to CN202010161748.5A priority Critical patent/CN111488271B/en
Publication of CN111488271A publication Critical patent/CN111488271A/en
Application granted granted Critical
Publication of CN111488271B publication Critical patent/CN111488271B/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/362Software debugging
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software

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)

Abstract

The embodiment of the invention relates to the field of performance prediction and discloses a message middleware tuning method, a system, electronic equipment and a storage medium. The tuning method comprises the following steps: simulating an actual service scene, extracting environment information corresponding to the actual service scene, and building a performance test environment of the message middleware according to the environment information; determining test parameters from parameters of the message middleware according to the environment information; performing performance test on the test parameters under the performance test environment of the message middleware to generate a pre-test result; determining a tuning mode of the test parameters according to the relation between the test service index and the preset service index and the relation between the test middleware performance index and the preset middleware performance index; and optimizing the test parameters according to the optimizing mode. The performance test and optimization are carried out on the message middleware through simulating the actual service scene, and the method has an actual guiding effect on the type selection and resource allocation of the message middleware in the actual service scene.

Description

Message middleware tuning method, system, electronic equipment and storage medium
Technical Field
The embodiment of the invention relates to the field of performance prediction, in particular to a message middleware tuning method, a system, electronic equipment and a storage medium.
Background
The message middleware has become an important tool for receiving, caching and sending mass data by virtue of the characteristics of decoupling capability, expandability, flexibility, peak processing capability, restorability, sequential delivery and the like, and is widely supported and applied in various fields.
Because the message middleware has strong universality, and can not fit the specific characteristics of the field when being applied to the specific field, the message middleware is important to the message middleware type selection and parameter tuning when being applied to the specific field.
However, the inventors of the present invention found that: in the prior art, the type selection and parameter tuning of the message middleware are based on the prediction of simple and ideal application scenes; because the actual service scenes generally have one or more or mixed management modes due to different scales, the performance prediction based on simple and ideal application scenes is not significant for guiding the message middleware selection and parameter tuning of the actual service scenes.
Disclosure of Invention
The invention aims to provide a message middleware tuning method, a system, electronic equipment and a storage medium, wherein a performance test environment of the message middleware is built by simulating an actual service scene, and proper message middleware parameters are selected as test parameters, so that the type and parameter tuning of the message middleware are matched with the specific characteristics of the field; the method has an actual guiding effect on the selection of the message middleware and the resource allocation in the actual service scene.
In order to solve the above technical problems, an embodiment of the present invention provides a method for tuning message middleware, including: simulating an actual service scene, extracting environment information corresponding to the actual service scene, and building a performance test environment of the message middleware according to the environment information; determining test parameters from parameters of the message middleware according to the environment information; in the performance test environment of the message middleware, performance test is carried out on the test parameters, and a pre-test result is generated, wherein the pre-test result comprises: testing service indexes and testing middleware performance indexes; determining a tuning mode of the test parameters according to the relation between the test service index and the preset service index and the relation between the test middleware performance index and the preset middleware performance index; and optimizing the test parameters according to the optimizing mode.
The embodiment of the invention also provides a tuning system of the message middleware, which comprises the following steps: the service scene simulation module is used for extracting environment information corresponding to the actual service scene and building a performance test environment of the message middleware according to the environment information; determining test parameters from parameters of the message middleware according to the environment information; the processing module is used for performing performance test on the test parameters under the performance test environment of the message middleware to generate a pre-test result, wherein the pre-test result comprises: testing service indexes and testing middleware performance indexes; determining a tuning mode of the test parameters according to the relation between the test service index and the preset service index and the relation between the test middleware performance index and the preset middleware performance index; and optimizing the test parameters according to the optimizing mode.
The embodiment of the invention also provides electronic equipment, which comprises: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the message middleware tuning method.
The embodiment of the invention also provides a storage medium which stores a computer program, and the computer program realizes the optimization method of the message middleware when being executed by a processor.
Compared with the prior art, the embodiment of the invention closely combines the scale and the message management mode under the actual service scene by simulating the performance test environment of the message middleware built under the actual service scene; selecting proper parameters from parameters of the message middleware as test parameters by combining environment information corresponding to the actual service scene, testing the test parameters in the built performance test environment of the message middleware, and enabling the obtained result to be more fit with the actual service scene, thereby having an actual guiding effect on the selection of the message middleware and the resource allocation in the actual service scene; and tuning the test parameters according to the test results to obtain better values of the test parameters.
In addition, in the performance test environment of the message middleware, performance test is carried out on the test parameters, and a pre-test result is generated, wherein the pre-test result comprises: testing service indexes and middleware performance indexes; determining a tuning mode of the test parameters according to the relation between the test service index and the preset service index and the relation between the test middleware performance index and the preset middleware performance index, wherein the tuning mode specifically comprises the following steps: in a performance test environment of the message middleware, performing performance test on a first numerical value of the test parameter to generate a first pre-test result, wherein the first pre-test result comprises: a first business index and a first middleware performance index; and adjusting the numerical value of the test parameter to obtain a second numerical value, performing performance test on the second numerical value of the test parameter to generate a second pre-test result, wherein the second pre-test result comprises: a second business index and a second middleware performance index; and determining a tuning mode of the test parameters according to the relation between the first service index and the second service index and the preset service index and the relation between the first middleware performance index and the second middleware performance index and the preset middleware performance index. According to the pre-test results of the two-round performance test, the comparison analysis is performed to obtain the tuning mode, so that the tuning of the message middleware is performed in the direction of optimization, and the accuracy is improved.
In addition, determining a tuning manner for the test parameter according to a relation between the first service index and the second service index and a preset service index and a relation between the first middleware performance index and the second middleware performance index and the preset middleware performance index, specifically includes: the tuning modes comprise forward tuning and reverse tuning; the forward tuning is performed in a direction away from the first value by taking the second value as a reference for the test parameter; reverse tuning is to perform tuning in a direction close to the first numerical value by taking the second numerical value as a reference for the test parameter; if the second service index meets the preset service index and is superior to the first service index, judging the performance index of the middleware is executed; the judging of the middleware performance index comprises the following steps: if the second middleware performance index meets the preset middleware performance index, forward tuning and optimizing the test parameters are carried out; if the second middleware performance index does not meet the preset middleware performance index, reversely optimizing the test parameters; if the second service index meets the preset service index and the first service index is better than the second service index, reversely optimizing the test parameters; if the second service index does not meet the preset service index and is better than the first service index, forward tuning of the test parameters is performed; and if the second service index does not meet the preset service index or the first service index is better than the second service index, reversely optimizing the test parameters.
In addition, after the test parameters are adjusted according to the adjustment mode, the method further comprises the following steps: the forward tuning and the reverse tuning are as follows: tuning according to a preset tuning interval in a dichotomy mode; repeating the following operations until the tuning step length is smaller than or equal to a preset step length: taking the second pre-test result as a first pre-test result, performing performance test on the optimized test parameters, generating an iteration test result as a second pre-test result, and recording; determining a tuning mode of the test parameters according to the relation between the test service index and the preset service index and the relation between the test middleware performance index and the preset middleware performance index; tuning the test parameters according to a tuning mode; and when the tuning step length is smaller than or equal to the preset step length, generating and outputting a performance tuning report according to the recorded each iteration test result, and acquiring and outputting the numerical value of the optimal test parameter according to the performance tuning report. Performing dichotomy iterative tuning on the tuned result, stopping iteration when the tuning step length is smaller than or equal to the preset step length, wherein the obtained tuning result is a more accurate test result; according to the performance tuning report generated by the result of each iteration test, the influence of each test parameter on the result can be intuitively seen, so that the method has more accurate guiding effect on the message middleware selection and resource allocation in the actual service scene.
In addition, before each performance test is performed on the test parameters, the method further comprises the following steps: initializing a performance testing environment of the message middleware. The performance test environment is initialized before each performance test, so that the consistency of initial conditions for each performance test is ensured, and the accuracy of test results is ensured.
In addition, when the performance test is carried out on the test parameters, the method further comprises the following steps: monitoring performance indexes of a performance test environment of the message middleware in real time; if the performance index cannot meet the preset performance requirement, the server resource occupation amount of the performance test environment of the message middleware is increased or the total test data amount of the performance test environment of the message middleware is reduced before the next performance test is started. Whether the performance index of the performance test environment reaches the preset performance index is monitored in real time, so that the performance test can be smoothly performed, and the efficiency of the performance test is improved.
Drawings
Fig. 1 is a specific flowchart of a tuning method of message middleware in a first embodiment according to the present invention;
FIG. 2 is a flowchart showing the tuning of test parameters according to the first embodiment of the present invention;
FIG. 3 is a flowchart showing a method for determining a tuning mode according to the first embodiment of the present invention;
FIG. 4 is a specific flow diagram of a method for tuning message middleware in accordance with a second embodiment of the present application;
FIG. 5 is a schematic diagram of virtual modules included in a tuning system for message middleware in accordance with a third embodiment of the present application;
fig. 6 is a schematic structural view of an electronic device according to a fourth embodiment of the present application.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present application more apparent, the following detailed description of the embodiments of the present application will be given with reference to the accompanying drawings. However, those of ordinary skill in the art will understand that in various embodiments of the present application, numerous technical details have been set forth in order to provide a better understanding of the present application. However, the claimed application may be practiced without these specific details and with various changes and modifications based on the following embodiments. The following embodiments are divided for convenience of description, and should not be construed as limiting the specific implementation of the present application, and the embodiments can be combined with each other and cited with each other without contradiction.
The first embodiment of the application relates to a message middleware tuning method, which comprises the following steps: simulating an actual service scene, extracting environment information corresponding to the actual service scene, and building a performance test environment of the message middleware according to the environment information; determining test parameters from parameters of the message middleware according to the environment information; in the performance test environment of the message middleware, performance test is carried out on the test parameters, and a pre-test result is generated, wherein the pre-test result comprises: testing service indexes and testing middleware performance indexes; determining a tuning mode of the test parameters according to the relation between the test service index and the preset service index and the relation between the test middleware performance index and the preset middleware performance index; and optimizing the test parameters according to the optimizing mode.
The implementation details of the device state detection method of the present embodiment are specifically described below.
The specific flowchart of the message middleware tuning method in this embodiment is shown in fig. 1, and specifically includes:
and step 101, simulating an actual service scene and building a performance test environment of the message middleware.
And simulating an actual service scene, extracting environment information corresponding to the actual service scene, and constructing a performance test environment of the message middleware according to the environment information.
Specifically, an actual service scene is simulated, a service topology model which is in butt joint with the message middleware is defined according to different service requirements, and the topology structure of the service topology model is determined according to environment information corresponding to the actual service scene. The service topology model comprises: production group, number of producers, consumption group, number of consumers, consumption pattern, topic/Queue definition, queue/multicast/broadcast pattern. Wherein, the production group and the number of producers refer to: the group of the upstream machines of the butt-joint message middleware and the number of the upstream machines are used for carrying out information transmission with the message middleware, so that the upstream business condition of the butt-joint message middleware is reflected; the consumption group and the number of consumers refer to: and the group of the downstream machines of the butt-joint message middleware and the number of the downstream machines are used for carrying out information transmission on the message middleware, so that the downstream business condition of the butt-joint message middleware is reflected.
Selecting the message middleware according to the service characteristics of the actual service scene; note that, the types of message middleware applicable to this embodiment include: rocketMQ, activeMQ, rabbitMQ. The message middleware is selected and evaluated mainly according to a message management mode, a message consumption mode, message reliability, architecture expandability and message middleware performance. After the message middleware is selected, the type of the message middleware, the service topology structure, the related parameters of the service topology model and the clients for simulating the producer and the consumer are obtained, and the clients such as the message queue, the message subscription and the consumption mode which are in butt joint with the message middleware are automatically configured according to the environment information. Specifically, adapting is performed in a single mode or a heterogeneous mode; the thread group is used for controlling message production, message consumption, the number of producers and the number of consumers; the process group is used for controlling a point-to-point mode, a one-to-many subscription mode, a broadcasting mode and a mixed mode; accordingly, the sizes of the producer and the consumer are managed based on the Jmeter thread group; a scene mode of message queues and message subscriptions is allocated based on the test resource schedule.
Step 102, determining test parameters from parameters of the message middleware.
And determining test parameters from parameters of the message middleware according to the environment information. Specifically, according to the environment information and the type of the selected message middleware, determining a proper parameter from parameters of the message middleware as a test parameter, and determining the numerical value of the test parameter to perform performance test.
It should be noted that, if the test parameters include multiple test parameters, layering processing needs to be performed on the test parameter objects. And then taking the determined test parameters as tuning objects one by one, and performing recursion tuning according to a preset tuning interval and tuning step length and a dichotomy principle.
And step 103, performing performance test under the performance test environment of the message middleware to obtain the tuning mode of the test parameters.
And under the performance test environment of the message middleware, performing performance test on the test parameters to generate a pre-test result, wherein the pre-test result comprises: testing service indexes and testing middleware performance indexes; and determining a tuning mode of the test parameters according to the relation between the test service index and the preset service index and the relation between the test middleware performance index and the preset middleware performance index.
Specifically, a specific flowchart for determining a tuning manner of a test parameter, referring to fig. 2, includes:
step 201, testing a first value of the test parameter to obtain a first pre-test result.
And in the performance test environment of the message middleware, performing performance test on the first numerical value of the test parameter to generate a first pre-test result, wherein the first pre-test result comprises: a first traffic index and a first middleware performance index.
Step 202, adjusting the value of the test parameter to obtain a second value.
And adjusting the value of the test parameter to obtain a second value according to the test result.
And 203, testing the second value of the test parameter to obtain a second pre-test result.
And in the performance test environment of the message middleware, performing performance test on the second numerical value of the test parameter to generate a second pre-test result, wherein the second pre-test result comprises: a second traffic index and a second middleware performance index.
Step 204, comparing and analyzing the first pre-test result and the second pre-test result to obtain the tuning mode of the test parameters.
And determining a tuning mode of the test parameter according to the relation between the first service index and the second service index and the preset service index and the relation between the first middleware performance index and the second middleware performance index and the preset middleware performance index.
Specifically, referring to fig. 3, a specific flowchart for comparing and analyzing the first pre-test result and the second pre-test result includes:
step 301, determining whether the second service index meets a preset service index. The traffic metrics include Transaction Per Second (TPS), average response time, error rate, etc. Specifically, if the tested service indexes include multiple types, each corresponding service index is required to meet the preset service index, and the service index can be judged to meet the preset service index.
Judging whether the second business index in the second pre-test result meets the preset business index or not, if the second pre-test result meets the preset business index, executing step 302, and judging whether the second business index is better than the first business index or not; if the second pre-test result does not meet the preset service index, step 312 is executed to determine whether the second service index is better than the first service index.
Step 302, judging whether the second service index is better than the first service index;
comparing and analyzing a first service index in the first pre-test result with a second service index in the second pre-test result, if the second service index is better than the first service index, indicating that the adjustment direction of the test parameter value is correct, executing step 303, and judging whether the second middleware performance index meets the preset middleware performance index; if the first traffic index is better than the second traffic index, it indicates that the adjustment direction of the test parameter value is wrong, step 314 is executed to perform the reverse adjustment of the test parameter.
Step 312, it is determined whether the second traffic indicator is better than the first traffic indicator.
Comparing and analyzing a first service index in the first pre-test result with a second service index in the second pre-test result, if the second service index is better than the first service index, indicating that the adjustment direction of the test parameter value is correct, executing step 304, and performing forward adjustment on the test parameter; if the first traffic index is better than the second traffic index, it indicates that the adjustment direction of the test parameter value is wrong, step 314 is executed to perform the reverse adjustment of the test parameter.
Step 303, determining whether the second middleware performance index meets a preset middleware performance index. The middleware performance indexes comprise CPU, memory, system I/O, bandwidth and Load Average. Specifically, if the tested middleware performance indexes include multiple types, each corresponding middleware performance index is required to meet the preset middleware performance index, and the middleware performance index can be judged to meet the preset middleware performance index.
Judging a second middleware performance index in a second pre-test result, if the second middleware performance index meets a preset middleware performance index, executing step 304, and performing forward optimization on the test parameters; if the second middleware performance index does not meet the preset middleware performance index, step 314 is executed to perform reverse tuning on the test parameters.
Step 304, forward tuning is carried out on the test parameters; and step 314, reversely optimizing the test parameters.
The tuning modes comprise forward tuning and reverse tuning; the forward tuning is that the test parameter is tuned in a direction away from the first value by taking the second value as a reference; and reverse tuning is to tune the test parameters in a direction approaching to the first numerical value by taking the second numerical value as a reference.
To sum up, (1) the solution formed by steps 301, 312 and 304, that is, if the second service index does not meet the preset service index and the second service index is better than the first service index, performs the forward tuning on the test parameter. (2) The solution formed by step 301, step 312 and step 314 is that if the second service indicator does not meet the preset service indicator, or the first service indicator is better than the second service indicator, the reverse tuning is performed on the test parameter. (3) The solution formed by step 301, step 302 and step 314 is that if the second service indicator meets the preset service indicator and the first service indicator is better than the second service indicator, the reverse tuning is performed on the test parameter. (4) The solution formed by step 301, step 302, step 303 and step 304, that is, if the second service index meets the preset service index, and the second service index is better than the first service index, and if the second middleware performance index meets the preset middleware performance index, performing the forward tuning on the test parameter. (5) The solution formed by step 301, step 302, step 303 and step 314 is that if the second service index meets the preset service index, and the second service index is better than the first service index, and if the second middleware performance index does not meet the preset middleware performance index, the reverse tuning is performed on the test parameter.
And 104, optimizing the test parameters according to the optimizing mode.
According to the embodiment of the invention, the performance test environment of the message middleware built in the actual service scene is simulated, and the scale and the message management mode in the actual service scene are tightly combined; selecting proper parameters from parameters of the message middleware as test parameters in combination with environment information corresponding to the actual service scene, and testing the test parameters in the built performance test environment of the message middleware, wherein the obtained result is more fit with the actual service scene; and tuning the test parameters according to the test results to obtain better values of the test parameters.
The above steps of the methods are divided, for clarity of description, and may be combined into one step or split into multiple steps when implemented, so long as they include the same logic relationship, and they are all within the protection scope of this patent; it is within the scope of this patent to add insignificant modifications to the algorithm or flow or introduce insignificant designs, but not to alter the core design of its algorithm and flow.
A second embodiment of the present invention relates to a method for tuning message middleware. The second embodiment is substantially the same as the first embodiment, and differs mainly in that: in the second embodiment, the test parameters after tuning are subjected to iterative test, a performance tuning report is obtained, and an optimal value of the test parameters is output.
The specific flowchart of the message middleware tuning method in this embodiment is shown in fig. 4, and specifically includes:
in this embodiment, before each performance test is performed on the test parameters, the method further includes: initializing a performance testing environment of the message middleware. Specifically, before each performance test, in order to ensure consistency of initial conditions of the test results of the two times before and after each performance test. Initializing the performance test environment of the whole message middleware, comprising: the method comprises the steps of simulating test scripts, test logs and test processes of producers and consumers, establishing queues or topics by the message middleware, releasing connection, storing the occupied disk space by message persistence and the like by using resources occupied by a tester and resources occupied by the message middleware, and configuring and restarting the middleware according to message middleware parameter values calculated by each performance test. The performance test environment is initialized before each performance test, so that the consistency of initial conditions for each performance test is ensured, and the accuracy of test results is ensured.
Step 401, simulating an actual service scene, and constructing a performance test environment of a message middleware; step 402, determining test parameters from parameters of the message middleware; step 403, performing performance test under the performance test environment of the message middleware to obtain a tuning mode of the test parameters; and step 404, tuning the test parameters according to the tuning mode.
Steps 401 to 404 are the same as steps 101 to 104 in the first embodiment; step 413 to step 443 are the same as step 201 to step 204 in the first embodiment, respectively; and will not be described in detail herein.
Step 405, whether the tuning step is smaller than or equal to a preset step.
In the present embodiment, tuning is performed according to a dichotomy method, and iterative tuning is performed according to a preset tuning interval. When the tuning step length is smaller than or equal to the preset step length, ending iterative tuning, entering step 407, and obtaining a performance tuning report and optimal test parameters; otherwise, step 406 is entered, wherein the second pre-test result is used as the first pre-test result, and the tuned test parameter is used as the second value.
Step 406, taking the second pre-test result as the first pre-test result, and taking the adjusted test parameter as the second value.
Step 406 is completed, step 433 is executed, and the second value of the test parameter is tested to obtain a second pre-test result; step 443, comparing and analyzing the first pre-test result and the second pre-test result to obtain the tuning mode of the test parameters; and step 404, tuning the test parameters according to the tuning mode. And performing performance test on the new second numerical value to obtain a new second pre-test result, performing contrast analysis, and obtaining a tuning mode of the test parameters for tuning.
Specifically, taking the second pre-test result as a first pre-test result, performing performance test on the optimized test parameters, generating an iteration test result as a second pre-test result, and recording; determining a tuning mode of the test parameters according to the relation between the test service index and the preset service index and the relation between the test middleware performance index and the preset middleware performance index; and optimizing the test parameters according to the optimizing mode.
In one example, a specific tuning method is shown in the following table:
let the first value be A and the second value be B, where B > A. The preset tuning interval is 4T, and the preset step length is T (t=t/4).
The setting of the tuning specific values is for the sake of clarity of those skilled in the art, and is not limited to the binary iteration tuning method in this embodiment, and in specific applications, the setting may be performed according to the parameter values required by the actual service scenario.
Step 407, obtaining a performance tuning report and optimal test parameters.
Specifically, after the tuning step length is smaller than or equal to the preset step length, generating and outputting a performance tuning report according to the recorded each iteration test result, and acquiring and outputting the value of the optimal test parameter according to the performance tuning report. According to the recorded performance tuning report generated by the result of each iteration test, the influence of each test parameter on the result can be intuitively seen.
The algorithm is characterized in that the parameter objects are subjected to layering treatment, the rapid convergence of the test parameter values in the performance tuning process is realized based on a binary recursion algorithm by setting intervals, step sizes and preset step sizes, and the performance results in each iteration test process are compared and analyzed based on the test results of the first two rounds, so that the stability and the accuracy of the algorithm are improved. When all the test parameters recursively reach the minimum step size, the algorithm ends.
It should be noted that, when the performance test is performed on the test parameters in this embodiment, the method further includes: and performing elastic calculation on the test resources. Specifically, performance indexes of a performance test environment of the message middleware are monitored in real time; if the performance index cannot meet the preset performance requirement, the server resource occupation amount of the performance test environment of the message middleware is increased or the total test data amount of the performance test environment of the message middleware is reduced before the next performance test is started. In one example, a single tester is assigned the number of simulated producers and consumers based on empirical values of laboratory tests. When the performance index of the testing machine cannot meet the preset performance index (the performance monitoring parameters are generally CPU, memory, I/O, bandwidth and Load Average) after the performance test is performed for the next round, the system allocates more server resources for the performance test or reduces the number of single simulated producers or consumers before the performance test is started for the next round. Whether the performance index of the performance test environment reaches the preset performance index is monitored in real time, so that the performance test can be smoothly performed, and the efficiency of the performance test is improved.
In the embodiment, the result after tuning is subjected to dichotomy iterative tuning, and iteration is stopped when the tuning step length is smaller than or equal to the preset step length, wherein the tuning result obtained at the moment is a more accurate test result; according to the performance tuning report generated by the result of each iteration test, the influence of each test parameter on the result can be intuitively seen, so that the method has more accurate guiding effect on the message middleware selection and resource allocation in the actual service scene.
The above steps of the methods are divided, for clarity of description, and may be combined into one step or split into multiple steps when implemented, so long as they include the same logic relationship, and they are all within the protection scope of this patent; it is within the scope of this patent to add insignificant modifications to the algorithm or flow or introduce insignificant designs, but not to alter the core design of its algorithm and flow.
A third embodiment of the present invention relates to a tuning system for message middleware, wherein a virtual module diagram thereof is shown with reference to fig. 5, and the tuning system comprises:
the service scene simulation module 501 is configured to extract environment information corresponding to an actual service scene, and build a performance test environment of the message middleware according to the environment information; and determining test parameters from parameters of the message middleware according to the environment information.
The service scenario simulation module 501 builds a performance test environment of the message middleware according to the actual service scenario. And then, performing performance test through the processing module 502 according to the determined test parameters of the message middleware to obtain the optimal test parameters and service performance indexes.
Specifically, the business scenario simulation module 501 includes: a scene definition unit 511, a management unit 521, and an adaptation unit 531.
The scene definition unit 511 is configured to simulate an actual service scene, and extract environmental information corresponding to the actual service scene.
Specifically, an actual service scene is simulated, a service topology model which is in butt joint with the message middleware is defined according to different service requirements, and the topology structure of the service topology model is determined according to environment information corresponding to the actual service scene. The service topology model comprises: production group, number of producers, consumption group, number of consumers, consumption pattern, topic/Queue definition, queue/multicast/broadcast pattern; the traffic topology is created by the management unit 521.
And the management unit 521 is configured to build and manage, according to the environment information, a performance test environment of the message middleware and definition and management of parameters of the message middleware. Specifically, the module serves as an entry for environment management and variable definition and management of the tuning system of the whole message middleware. I.e. management unit 521 is used for both the environment management and the parameter management.
The environment management comprises a performance test environment and the environment management of message middleware; wherein the performance test environment management comprises: testing a server resource list, performance monitoring indexes and standards, performance execution paths and scripts, environment initialization paths and scripts; the environment management of the message middleware comprises: the method comprises the steps of message middleware type, message theme/queue, message middleware start-stop operation, storage initialization operation script, and message middleware performance monitoring index and standard.
The parameter management comprises performance test parameters, parameter definition and tuning interval of message middleware and step length setting. Wherein the performance test parameters include the number and pattern of consumers, the number and pattern of producers; the parameter definitions of the message middleware include configuration parameter 1 (parameter name, parameter interval and step size, minimum step size), configuration parameter 2 (parameter name, parameter interval and step size, minimum step size) … … up to configuration parameter n (parameter name, parameter interval and step size, minimum step size). For example, the parameter flushdisktype= (async_flush||sync_flush), defaulttopicqueue number recommendation 8 setting interval may be 4 to 1024.
The adapting unit 531, the docking scene defining unit and the managing unit are configured to determine a test parameter from parameters of the message middleware according to the environmental information.
Specifically, the message middleware is selected according to the service characteristics of the actual service scene, and it should be noted that the types of the message middleware applicable to the embodiment include: rocketMQ, activeMQ, rabbitMQ. The message middleware is selected and evaluated mainly according to a message management mode, a message consumption mode, message reliability, architecture expandability and message middleware performance. After the message middleware is selected, the type of the message middleware, the service topology structure, the related parameters of the service topology model and the clients for simulating the producer and the consumer are obtained, and the clients such as the message queue, the message subscription and the consumption mode which are in butt joint with the message middleware are automatically configured according to the environment information. Specifically, adapting is performed in a single mode or a heterogeneous mode; the thread group is used for controlling message production, message consumption, the number of producers and the number of consumers; the process group is used for controlling a point-to-point mode, a one-to-many subscription mode, a broadcasting mode and a mixed mode; accordingly, the sizes of the producer and the consumer are managed based on the Jmeter thread group; a scene mode of message queues and message subscriptions is allocated based on the test resource schedule.
The processing module 502 performs performance test on the test parameters under the performance test environment of the message middleware, and generates a pre-test result, where the pre-test result includes: testing service indexes and testing middleware performance indexes; determining a tuning mode of the test parameters according to the relation between the test service index and the preset service index and the relation between the test middleware performance index and the preset middleware performance index; and optimizing the test parameters according to the optimizing mode.
Compared with the prior art, the embodiment of the invention simulates the performance test environment of the message middleware built in the actual service scene through the service scene simulation module, and closely combines the scale and the message management mode in the actual service scene; selecting proper parameters from parameters of the message middleware as test parameters by combining environment information corresponding to an actual service scene; the processing module tests the test parameters in the built performance test environment of the message middleware, and the obtained result is more fit with the actual service scene, so that the tuning system of the message middleware disclosed by the embodiment has an actual guiding effect on the type selection and resource allocation of the message middleware in the actual service scene.
It is to be noted that this embodiment is a system example corresponding to the first embodiment and the second embodiment, and can be implemented in cooperation with the first embodiment and the second embodiment. The related technical details mentioned in the first embodiment and the second embodiment are still valid in this embodiment, and in order to reduce repetition, a detailed description is omitted here. Accordingly, the related technical details mentioned in the present embodiment can also be applied to the first embodiment and the second embodiment.
It should be noted that each module in this embodiment is a logic module, and in practical application, one logic unit may be one physical unit, or may be a part of one physical unit, or may be implemented by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, units that are not so close to solving the technical problem presented by the present invention are not introduced in the present embodiment, but this does not indicate that other units are not present in the present embodiment.
A fourth embodiment of the present invention relates to an electronic device, and the specific structure of the electronic device is shown in fig. 6. Including at least one processor 602; and a memory 601 communicatively coupled to the at least one processor 602. The memory 601 stores instructions executable by the at least one processor 602, and the instructions are executed by the at least one processor 602, so that the at least one processor 602 can execute the message middleware tuning method in the above embodiment.
In the present embodiment, the processor 602 is exemplified by a central processing unit (Central Processing Unit, CPU), and the memory 601 is exemplified by a readable/writable memory (Random Access Memory, RAM). The processor 602, the memory 601 may be connected by a bus or otherwise, for example in fig. 6. The memory 601 is a non-volatile computer-readable storage medium that can be used to store a non-volatile software program, a non-volatile computer-executable program, and a module, such as a program for implementing a device state detection method in the embodiment of the present application, is stored in the memory 601. The processor 602 executes various functional applications of the device and data processing, i.e., implements the above-described device state detection method, by running nonvolatile software programs, instructions, and modules stored in the memory 601.
The memory 601 may include a storage program area that may store an operating system, at least one application program required for functions, and a storage data area; the storage data area may store a list of options, etc. In addition, the memory 601 may include high-speed random access memory, and may also include non-volatile memory, such as at least one magnetic disk storage device, flash memory device, or other non-volatile solid-state storage device. In some embodiments, memory 601 optionally includes memory located remotely from processor 602, which may be connected to an external device via a network.
One or more program modules are stored in the memory 601 that, when executed by the one or more processors 602, perform the message middleware tuning method of any of the method embodiments described above.
The above product may perform the method provided by the embodiment of the present application, and have functional modules and beneficial effects corresponding to the execution method, and technical details not described in detail in the embodiment of the present application may be referred to other embodiments of the present application.
A fifth embodiment of the present application relates to a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
That is, it will be understood by those skilled in the art that all or part of the steps in implementing the methods of the embodiments described above may be implemented by a program stored in a storage medium, where the program includes several instructions for causing a device (which may be a single-chip microcomputer, a chip or the like) or a processor (processor) to perform all or part of the steps in the methods of the embodiments of the application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples of carrying out the invention and that various changes in form and details may be made therein without departing from the spirit and scope of the invention.

Claims (8)

1. A method for optimizing message middleware, comprising:
simulating an actual service scene, extracting environment information corresponding to the actual service scene, and building a performance test environment of the message middleware according to the environment information;
determining test parameters from parameters of the message middleware according to the environment information;
and under the performance test environment of the message middleware, performing performance test on the test parameters to generate a pre-test result, wherein the pre-test result comprises: testing service indexes and testing middleware performance indexes; determining a tuning mode of the test parameter according to the relation between the test service index and the preset service index and the relation between the test middleware performance index and the preset middleware performance index, wherein the tuning mode specifically comprises the following steps: and in the performance test environment of the message middleware, performing performance test on the first numerical value of the test parameter to generate a first pre-test result, wherein the first pre-test result comprises: a first business index and a first middleware performance index; adjusting the value of the test parameter to obtain a second value, performing performance test on the second value of the test parameter, and generating a second pre-test result, wherein the second pre-test result comprises: a second business index and a second middleware performance index; if the second service index meets the preset service index and is better than the first service index, judging the performance index of the middleware; wherein, the judging of the middleware performance index comprises: if the second middleware performance index meets the preset middleware performance index, forward tuning is performed on the test parameters; if the second middleware performance index does not meet the preset middleware performance index, reversely optimizing the test parameters; if the second service index meets the preset service index and the first service index is better than the second service index, performing the reverse optimization on the test parameter; if the second service index does not meet the preset service index and the second service index is better than the first service index, performing the forward tuning on the test parameter; if the second service index does not meet the preset service index or the first service index is better than the second service index, performing the reverse tuning on the test parameter; the forward tuning is that the test parameter is tuned in a direction away from the first value by taking the second value as a reference; reverse tuning is that the test parameters are tuned in a direction close to the first value by taking the second value as a reference;
Tuning the test parameters according to the tuning mode;
wherein, when carrying out the performance test to the test parameter, still include: the method for carrying out elastic calculation on the test resources specifically comprises the following steps: monitoring performance indexes of a performance test environment of the message middleware in real time; if the performance index cannot meet the preset performance requirement, the server resource occupation amount of the performance test environment of the message middleware is increased or the total test data amount of the performance test environment of the message middleware is reduced before the next performance test is started.
2. The method for tuning the message middleware according to claim 1, further comprising, after tuning the test parameter according to the tuning manner:
the forward tuning and the reverse tuning are as follows: tuning according to a preset tuning interval in a dichotomy mode;
repeating the following operations until the tuning step length is smaller than or equal to a preset step length:
taking the second pre-test result as the first pre-test result, performing performance test on the optimized test parameters, generating an iteration test result as the second pre-test result, and recording;
determining a tuning mode of the test parameters according to the relation between the test service index and a preset service index and the relation between the test middleware performance index and a preset middleware performance index;
Tuning the test parameters according to the tuning mode;
and when the tuning step length is smaller than or equal to the preset step length, generating and outputting a performance tuning report according to the recorded each iteration test result, and acquiring and outputting the optimal numerical value of the test parameter according to the performance tuning report.
3. The method of tuning message middleware according to any one of claims 1-2, further comprising, before each performance test of the test parameters: initializing a performance test environment of the message middleware.
4. The method for tuning message middleware according to any one of claims 1-2, wherein when performing the performance test on the test parameter, the method further comprises:
monitoring performance indexes of the performance test environment of the message middleware in real time;
if the performance index cannot meet the preset performance requirement, the server resource occupation amount of the performance test environment of the message middleware is increased or the total test data amount of the performance test environment of the message middleware is reduced before the next performance test is started.
5. A system for tuning message middleware, comprising:
The service scene simulation module is used for extracting environment information corresponding to an actual service scene and building a performance test environment of the message middleware according to the environment information; determining test parameters from parameters of the message middleware according to the environment information;
the processing module is used for performing performance test on the test parameters under the performance test environment of the message middleware to generate a pre-test result, wherein the pre-test result comprises the following components: testing service indexes and testing middleware performance indexes; determining a tuning mode of the test parameters according to the relation between the test service index and a preset service index and the relation between the test middleware performance index and a preset middleware performance index; and optimizing the test parameters according to the optimizing mode, wherein the method specifically comprises the following steps: and in the performance test environment of the message middleware, performing performance test on the first numerical value of the test parameter to generate a first pre-test result, wherein the first pre-test result comprises: a first business index and a first middleware performance index; adjusting the value of the test parameter to obtain a second value, performing performance test on the second value of the test parameter, and generating a second pre-test result, wherein the second pre-test result comprises: a second business index and a second middleware performance index; if the second service index meets the preset service index and is better than the first service index, judging the performance index of the middleware; wherein, the judging of the middleware performance index comprises: if the second middleware performance index meets the preset middleware performance index, forward tuning is performed on the test parameters; if the second middleware performance index does not meet the preset middleware performance index, reversely optimizing the test parameters; if the second service index meets the preset service index and the first service index is better than the second service index, performing the reverse optimization on the test parameter; if the second service index does not meet the preset service index and the second service index is better than the first service index, performing the forward tuning on the test parameter; if the second service index does not meet the preset service index or the first service index is better than the second service index, performing the reverse tuning on the test parameter; the forward tuning is that the test parameter is tuned in a direction away from the first value by taking the second value as a reference; and reverse tuning is to tune the test parameters in a direction approaching to the first numerical value by taking the second numerical value as a reference.
6. The message middleware tuning system of claim 5, wherein the business scenario simulation module specifically comprises:
the scene definition unit is used for simulating an actual service scene and extracting environment information corresponding to the actual service scene;
the management unit is used for constructing and managing the performance test environment of the message middleware and the definition and management of parameters of the message middleware according to the environment information;
and the adaptation unit is in butt joint with the scene definition unit and the management unit and is used for determining test parameters from parameters of the message middleware according to the environment information.
7. An electronic device, comprising:
at least one processor; and a memory communicatively coupled to the at least one processor;
wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the message middleware tuning method of any one of claims 1 to 4.
8. A readable storage medium storing a computer program, wherein the computer program when executed by a processor implements the message middleware tuning method of any one of claims 1 to 4.
CN202010161748.5A 2020-03-10 2020-03-10 Message middleware tuning method, system, electronic equipment and storage medium Active CN111488271B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010161748.5A CN111488271B (en) 2020-03-10 2020-03-10 Message middleware tuning method, system, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010161748.5A CN111488271B (en) 2020-03-10 2020-03-10 Message middleware tuning method, system, electronic equipment and storage medium

Publications (2)

Publication Number Publication Date
CN111488271A CN111488271A (en) 2020-08-04
CN111488271B true CN111488271B (en) 2023-10-27

Family

ID=71798082

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010161748.5A Active CN111488271B (en) 2020-03-10 2020-03-10 Message middleware tuning method, system, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111488271B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112015620A (en) * 2020-08-19 2020-12-01 浙江无极互联科技有限公司 Method for automatically adjusting and optimizing parameters of website service end system
CN112015619A (en) * 2020-08-19 2020-12-01 浙江无极互联科技有限公司 Method for optimizing and screening core key indexes of system through parameters
CN112217886B (en) * 2020-09-27 2023-04-28 建信金融科技有限责任公司 Distributed system testing method and system, message production and consumption module
CN114095568B (en) * 2021-06-02 2023-09-12 北京机电工程研究所 Message transmitting device and method based on middleware technology

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102946616A (en) * 2012-11-21 2013-02-27 山东中创软件商用中间件股份有限公司 Internet of things middleware performance testing system and testing method
CN105786682A (en) * 2016-02-29 2016-07-20 上海新炬网络信息技术有限公司 Implementation system and method for avoiding software performance failure
CN108446210A (en) * 2018-02-07 2018-08-24 平安科技(深圳)有限公司 Measure, storage medium and the server of system performance
CN109388565A (en) * 2018-09-27 2019-02-26 西安电子科技大学 Software system performance optimization method based on production confrontation network
CN110175110A (en) * 2019-05-31 2019-08-27 深圳前海微众银行股份有限公司 Method for testing pressure, device, system, equipment and computer readable storage medium
CN110825629A (en) * 2019-10-31 2020-02-21 深圳市商汤科技有限公司 Parameter tuning method and related device

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR102205805B1 (en) * 2014-04-30 2021-01-21 삼성전자주식회사 Apparatus and method for automatically performing network optimization process in mobile communication system
CA2948700A1 (en) * 2015-08-11 2017-02-11 Txmq, Inc. Systems and methods for websphere mq performance metrics analysis
US10079719B2 (en) * 2016-06-29 2018-09-18 International Business Machines Corporation Automatically tuning middleware in a mobilefirst platform running in a docker container infrastructure

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102946616A (en) * 2012-11-21 2013-02-27 山东中创软件商用中间件股份有限公司 Internet of things middleware performance testing system and testing method
CN105786682A (en) * 2016-02-29 2016-07-20 上海新炬网络信息技术有限公司 Implementation system and method for avoiding software performance failure
CN108446210A (en) * 2018-02-07 2018-08-24 平安科技(深圳)有限公司 Measure, storage medium and the server of system performance
CN109388565A (en) * 2018-09-27 2019-02-26 西安电子科技大学 Software system performance optimization method based on production confrontation network
CN110175110A (en) * 2019-05-31 2019-08-27 深圳前海微众银行股份有限公司 Method for testing pressure, device, system, equipment and computer readable storage medium
CN110825629A (en) * 2019-10-31 2020-02-21 深圳市商汤科技有限公司 Parameter tuning method and related device

Also Published As

Publication number Publication date
CN111488271A (en) 2020-08-04

Similar Documents

Publication Publication Date Title
CN111488271B (en) Message middleware tuning method, system, electronic equipment and storage medium
CN102214139B (en) Automatic test performance control and debugging method facing distributed system
CN110554958B (en) Graph database testing method, system, device and storage medium
CN109189572B (en) Resource estimation method and system, electronic equipment and storage medium
CN109254913A (en) Collaborative share method, apparatus, electronic equipment and computer storage medium
CN112631919A (en) Comparison test method and device, computer equipment and storage medium
CN113835419A (en) Test method and system of train control equipment and storage medium
CN115391219A (en) Test case generation method and device, electronic equipment and storage medium
CN110503297B (en) Service scene acquisition method and device, electronic equipment and medium
CN113342500B (en) Task execution method, device, equipment and storage medium
CN112202647B (en) Test method, device and test equipment in block chain network
CN111949521B (en) Software performance test method and device
CN108463813B (en) Method and device for processing data
CN116300833A (en) Internet of vehicles simulation test method and device, electronic equipment and storage medium
CN116204396A (en) Test method and device for performance of analytical database
CN109933506A (en) Server big data method of evaluating performance, system and electronic equipment and storage medium
CN109151007B (en) Data processing method, core server and transmission server for application scheduling
CN113434405A (en) Method and device for determining test file, storage medium and electronic device
CN114189454B (en) Evaluation method, framework, device and electronic equipment of network scheduling strategy
CN112035360A (en) Middleware testing method and device, computer equipment and readable storage medium
CN116932417B (en) Performance tuning method and device
CN114143235A (en) NFV automatic test method, device, equipment and storage medium
CN111240920B (en) Performance test method, device, server and storage medium
CN115373696B (en) Low code configuration method, system, equipment and storage medium for software resource generation
CN117041116A (en) Communication test method and system

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