CN113342588A - Method and device for carrying out pressure test on server based on dynamic adjustment load - Google Patents

Method and device for carrying out pressure test on server based on dynamic adjustment load Download PDF

Info

Publication number
CN113342588A
CN113342588A CN202110894162.4A CN202110894162A CN113342588A CN 113342588 A CN113342588 A CN 113342588A CN 202110894162 A CN202110894162 A CN 202110894162A CN 113342588 A CN113342588 A CN 113342588A
Authority
CN
China
Prior art keywords
server
state
load
parameter
test
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
CN202110894162.4A
Other languages
Chinese (zh)
Other versions
CN113342588B (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.)
Beijing Jindi Technology Co Ltd
Original Assignee
Beijing Jindi 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 Beijing Jindi Technology Co Ltd filed Critical Beijing Jindi Technology Co Ltd
Priority to CN202110894162.4A priority Critical patent/CN113342588B/en
Publication of CN113342588A publication Critical patent/CN113342588A/en
Application granted granted Critical
Publication of CN113342588B publication Critical patent/CN113342588B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2205Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested
    • G06F11/2236Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing using arrangements specific to the hardware being tested to test CPU or processors
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/22Detection or location of defective computer hardware by testing during standby operation or during idle time, e.g. start-up testing
    • G06F11/2273Test methods

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Theoretical Computer Science (AREA)
  • Computer Hardware Design (AREA)
  • Quality & Reliability (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Test And Diagnosis Of Digital Computers (AREA)

Abstract

The embodiment of the invention discloses a method and a device for carrying out pressure test on a server based on dynamic adjustment load, a storage medium and electronic equipment, wherein the method comprises the following steps: detecting the running state of the server in the pressure testing process to acquire the running state information of the server in the pressure testing process; processing the running state information to obtain state parameters of the server, and enabling the server to enter a dynamic test mode capable of dynamically adjusting the load when the server is determined to be in a load early warning state based on the state parameters; and in the dynamic test mode, performing pressure test on the server in a mode of dynamically adjusting the load based on the state parameters. The invention can dynamically adjust the load and then carry out the pressure test when meeting the load bottleneck in the pressure test, thereby more accurately obtaining the maximum load value of the server.

Description

Method and device for carrying out pressure test on server based on dynamic adjustment load
Technical Field
The invention relates to the technical field of computer information processing, in particular to a method and a device for carrying out pressure test on a server based on dynamic adjustment load, a storage medium and electronic equipment.
Background
Currently, in order to determine the upper limit of the concurrent processing capacity of the server (i.e. the maximum number of requests that the server can process per unit time), the server is usually required to be stress tested. The purpose of server stress testing is to determine the reliability, performance bottlenecks, etc. of a server by performing repeatable load tests before the load reaches a limit.
However, during stress testing, the server may prematurely touch the load bottleneck. Reaching the bottleneck prematurely may be caused by too fast a load on the server or may be caused by an anomaly in other parts of the server. In fact, in this case, the server does not reach a real load bottleneck. Premature access to the load bottleneck may cause the pressure test to end prematurely, thereby failing to obtain accurate pressure test results.
Disclosure of Invention
The technical problem to be solved by the invention is how to avoid ending the pressure test by mistake, thereby improving the efficiency of the pressure test of the server. The invention adopts the technical scheme of carrying out pressure test on the server based on the dynamic adjustment load. When determining that the pressure measurement data in the pressure test process of the server is abnormal, the invention reduces the load of the server for observation, for example, reduces the query rate Per second QPS (queries Per second) of the server. During the observation period, if the pressure measurement data changes from abnormal to normal, the load continues to be increased to test the maximum load value of the server. If during the observation period, the pressure measurement data is found to continue to deteriorate, indicating that the processing power of the server is severely reduced (e.g., online monitoring alarms, a surge in error rate, etc.), the pressure test on the server is immediately stopped.
The present invention is proposed to solve the above-described technical problems such as early termination of the pressure test. The embodiment of the invention provides a method and a device for performing stress test on a server based on dynamic adjustment load, a storage medium and electronic equipment.
According to an aspect of the embodiments of the present invention, there is provided a method for performing a stress test on a server based on a dynamic adjustment load, including: detecting the running state of the server in the pressure testing process to acquire the running state information of the server in the pressure testing process; processing the running state information to obtain state parameters of the server, and enabling the server to enter a dynamic test mode capable of dynamically adjusting the load when the server is determined to be in a load early warning state based on the state parameters; and in the dynamic test mode, performing pressure test on the server in a mode of dynamically adjusting the load based on the state parameters.
Optionally, in the foregoing method embodiments of the present invention, when the server does not enter a dynamic test mode capable of dynamically adjusting the load, the method further includes performing a stress test on the server according to a preset load increase mode.
Optionally, in each of the above method embodiments of the present invention, the detecting an operation state of the server in the process of the stress test includes: determining a time cell associated with the stress test; selecting a plurality of time units for operating state detection; and acquiring respective operation data items of the server in the stress test process in each time unit in the plurality of time units.
Optionally, in the foregoing method embodiments of the present invention, the acquiring operation state information of the server in the stress test process includes: and constituting the operation state information of the server in the stress test process by the respective operation data items in each time unit in the plurality of time units.
Optionally, in the above method embodiments of the present invention, the operation data item includes the following attributes: average request elapsed time, predetermined quantile request elapsed time, minimum request elapsed time, request success rate, and number of requests in a time unit.
Optionally, in the foregoing method embodiments of the present invention, processing the running state information to obtain the state parameter of the server includes: extracting a respective operation data item for each of a plurality of time units from the operation state information; selecting at least one key attribute from a plurality of attributes of the operational data item; a state parameter of the server is determined based on the at least one key attribute.
Optionally, in the foregoing method embodiments of the present invention, after processing the running state information to obtain the state parameter of the server, the method further includes: determining an operating state of the server based on the state parameters, the operating state comprising: a load early warning state, a load normal state and an operation early warning state.
Optionally, in each of the method embodiments of the present invention, when it is determined that the server is in a normal load state based on the state parameter, the server does not enter a dynamic test mode capable of dynamically adjusting the load; or when the server is determined to be in the operation early warning state based on the state parameters, stopping pressure testing on the server, and uploading the operation state information of the server in the pressure testing process to the log server.
Optionally, in each of the method embodiments of the present invention, when the server enters a dynamic test mode capable of dynamically adjusting the load, the current time is recorded as the detection time of the load warning state.
Optionally, in the foregoing method embodiments of the present invention, the performing a stress test on the server in a manner of dynamically adjusting the load based on the state parameter includes: and in a first preset time period from the detection time of the load early warning state, carrying out stress test on the server by using the current load when the server enters a dynamic test mode.
Optionally, in the foregoing method embodiments of the present invention, further includes performing running state detection on the server entering the dynamic test mode, so as to obtain a respective running data item in each time unit of a plurality of time units of the server within the first predetermined time period.
Optionally, in each of the method embodiments of the present invention, further including performing data fitting on a plurality of operation data items of a plurality of time units of the server within a first predetermined time period based on the initial fitting parameters to generate a server state curve.
Optionally, in each of the above method embodiments of the present invention, after generating the server state curve, the method further includes: determining whether the server state curve has trend jitter; and if the trend jitter exists, adjusting the fitting parameters and performing data fitting on a plurality of operation data items of a plurality of time units of the server within a first preset time period based on the adjusted fitting parameters until the server state curve does not have the trend jitter.
Optionally, in the foregoing method embodiments of the present invention, further includes determining a trend state of the server according to the server state curve, where the trend state includes: toward a healthy state and toward a deteriorated state.
Optionally, in each of the above method embodiments of the present invention, when the trend state of the server is a trend worsening state, the load of the server is dynamically adjusted based on the state parameter to obtain a dynamically adjusted load; and carrying out stress test on the server with the dynamically adjusted load until the trend state of the server is towards the healthy state.
Optionally, in the foregoing method embodiments of the present invention, when the trend state of the server is a trend health state, the server is subjected to a stress test with a dynamically adjusted load in a second predetermined time period; detecting the running state of the server within a second preset time period to acquire the running state information of the server within the second preset time period; processing the running state information in the second preset time period to acquire state parameters in the second preset time period; and when the server is determined to be in the load normal state based on the state parameters in the second preset time period, the server is quitted from the dynamic test mode capable of dynamically adjusting the load.
Optionally, in each of the above method embodiments of the present invention, after the server exits from the dynamic test mode capable of dynamically adjusting the load, it is determined whether a test time period for performing the stress test on the server expires, and if the test time period expires, the stress test on the server is stopped; if not, continuing to stress the server.
Optionally, in the foregoing method embodiments of the present invention, determining the state parameter of the server based on the at least one key attribute includes: determining a target key attribute from the at least one key attribute; acquiring a plurality of attribute values of a target key attribute, and determining a server operation parameter based on the attribute values; acquiring a first threshold value and a second threshold value which are associated with a target key attribute; and determining the state parameter of the server according to the server operation parameter, the first threshold value and the second threshold value.
Optionally, in each of the above method embodiments of the present invention, determining the state parameter of the server according to the server operation parameter, the first threshold, and the second threshold includes: when the server operation parameter is larger than or equal to the first threshold value, determining that the state value of the state parameter of the server is normal and the deviation value is null; when the server operation parameter is smaller than a first threshold and larger than or equal to a second threshold, determining that the state value of the state parameter of the server is a load early warning and the deviation value is the ratio of the server operation parameter to the first threshold; when the server operation parameter is smaller than a second threshold value, determining that the state value of the state parameter of the server is operation early warning and the deviation value is null; wherein the state parameters include: state values and offset values.
Optionally, in the foregoing method embodiments of the present invention, wherein dynamically adjusting the load of the server based on the state parameter to obtain the dynamically adjusted load includes: acquiring a first dynamic adjustment factor from a configuration file of a server; determining a second dynamic adjustment factor based on the deviation value in the state parameter; and dynamically adjusting the load of the server based on the first dynamic adjustment factor and the second dynamic adjustment factor to obtain the dynamically adjusted load.
Optionally, in the foregoing method embodiments of the present invention, wherein dynamically adjusting the load of the server based on the first dynamic adjustment factor and the second dynamic adjustment factor to obtain the dynamically adjusted load includes: calculating an average value of the first dynamic adjustment factor and the second dynamic adjustment factor; and taking the product of the load of the server and the average value as the dynamically adjusted load, thereby dynamically adjusting the load of the server.
According to another aspect of the embodiments of the present invention, there is provided an apparatus for performing a stress test on a server based on a dynamically adjusted load, including: the detection module is used for detecting the running state of the server in the pressure test process so as to acquire the running state information of the server in the pressure test process; the control module is used for processing the running state information to obtain the state parameters of the server, and when the server is determined to be in a load early warning state based on the state parameters, the server enters a dynamic test mode capable of dynamically adjusting the load; and the test module is used for carrying out pressure test on the server in a mode of dynamically adjusting the load based on the state parameters in the dynamic test mode.
Optionally, in the above apparatus embodiments of the present invention, the test module is further configured to perform a stress test on the server according to a preset load increase mode when the server does not enter a dynamic test mode capable of dynamically adjusting a load.
Optionally, in each of the above apparatus embodiments of the present invention, the detecting module includes: a first determination unit for determining a time unit associated with the stress test; a first selection unit for selecting a plurality of time units for operation state detection; the first acquisition unit is used for acquiring the respective operation data items of the server in the stress test process in each time unit of the plurality of time units.
Optionally, in the above apparatus embodiments of the present invention, the detection module is further configured to configure the respective operation data item in each time unit of the multiple time units as the operation status information of the server during the stress test.
Optionally, in the above apparatus embodiments of the present invention, the operation data item includes the following attributes: average request elapsed time, predetermined quantile request elapsed time, minimum request elapsed time, request success rate, and number of requests in a time unit.
Optionally, in each of the above device embodiments of the present invention, the control module includes: an extraction unit configured to extract, from the operation state information, an operation data item for each of the plurality of time units; a second selecting unit for selecting at least one key attribute from the plurality of attributes of the run data item; a second determining unit for determining a state parameter of the server based on the at least one key attribute.
Optionally, in each of the above apparatus embodiments of the present invention, the control module is further configured to determine an operating state of the server based on the state parameter, where the operating state includes: a load early warning state, a load normal state and an operation early warning state.
Optionally, in each of the apparatus embodiments of the present invention, the control module is further configured to, when it is determined that the server is in a normal load state based on the state parameter, the server does not enter a dynamic test mode capable of dynamically adjusting the load.
Optionally, in each of the apparatus embodiments of the present invention, the control module is further configured to stop performing the pressure test on the server when it is determined that the server is in the operation early warning state based on the state parameter, and upload the operation state information of the server in the pressure test process to the log server.
Optionally, in the above apparatus embodiments of the present invention, the control module is further configured to record a current time as a detection time of the load warning state when the server enters a dynamic test mode capable of dynamically adjusting the load.
Optionally, in each of the apparatus embodiments of the present invention, the test module is specifically configured to perform a stress test on the server with a current load when the server enters the dynamic test mode within a first predetermined time period from the detection time of the load warning state.
Optionally, in the above apparatus embodiments of the present invention, the test module is further configured to perform running state detection on the server entering the dynamic test mode, so as to obtain a respective running data item in each time unit of a plurality of time units of the server within the first predetermined time period.
Optionally, in each of the apparatus embodiments of the present invention, the test module is further configured to perform data fitting on a plurality of operation data items of a plurality of time units of the server within a first predetermined time period based on the initial fitting parameter, so as to generate a server state curve.
Optionally, in each of the above apparatus embodiments of the present invention, the test module further includes: a third determining unit, configured to determine whether a trend jitter exists in the server state curve; and the first adjusting unit is used for adjusting the fitting parameters and performing data fitting on a plurality of running data items of a plurality of time units of the server within a first preset time period on the basis of the adjusted fitting parameters until the server state curve has no trend jitter.
Optionally, in each of the above apparatus embodiments of the present invention, the test module is further configured to determine a trend state of the server according to the server state curve, where the trend state includes: toward a healthy state and toward a deteriorated state.
Optionally, in each of the apparatus embodiments of the present invention, the test module is further configured to, when the trend state of the server is a trend worsening state, dynamically adjust the load of the server based on the state parameter to obtain a dynamically adjusted load; and carrying out stress test on the server with the dynamically adjusted load until the trend state of the server is towards the healthy state.
Optionally, in the above apparatus embodiments of the present invention, the testing module is further configured to perform a stress test on the server with a dynamically adjusted load in a second predetermined time period when the trend state of the server is a trend toward healthy state.
Optionally, in each of the apparatus embodiments of the present invention, the monitoring module is further configured to perform operation state detection on the server within a second predetermined time period, so as to obtain operation state information of the server within the second predetermined time period.
Optionally, in each of the apparatus embodiments of the present invention, the control module is further configured to process the running state information in a second predetermined time period to obtain a state parameter in the second predetermined time period; and when the server is determined to be in the load normal state based on the state parameters in the second preset time period, the server is quitted from the dynamic test mode capable of dynamically adjusting the load.
Optionally, in each of the apparatus embodiments of the present invention, the test module is further configured to determine whether a test time period for performing a stress test on the server expires after the server exits from the dynamic test mode capable of dynamically adjusting the load, and if the test time period expires, stop performing the stress test on the server; if not, continuing to stress the server.
Optionally, in each of the above device embodiments of the present invention, the control module further includes: a fourth determining unit, configured to determine a target key attribute from the at least one key attribute; the second acquisition unit is used for acquiring a plurality of attribute values of the target key attribute and determining the operation parameters of the server based on the attribute values; a third acquiring unit, configured to acquire a first threshold and a second threshold associated with the target key attribute; and the fifth determining unit is used for determining the state parameter of the server according to the server operation parameter, the first threshold and the second threshold.
Optionally, in each of the apparatus embodiments of the present invention, the fifth determining unit is specifically configured to: when the server operation parameter is larger than or equal to the first threshold value, determining that the state value of the state parameter of the server is normal and the deviation value is null; when the server operation parameter is smaller than a first threshold and larger than or equal to a second threshold, determining that the state value of the state parameter of the server is a load early warning and the deviation value is the ratio of the server operation parameter to the first threshold; when the server operation parameter is smaller than a second threshold value, determining that the state value of the state parameter of the server is operation early warning and the deviation value is null; wherein the state parameters include: state values and offset values.
Optionally, in each of the above apparatus embodiments of the present invention, the test module further includes: the fourth acquisition unit is used for acquiring the first dynamic adjustment factor from the configuration file of the server; a sixth determining unit for determining a second dynamic adjustment factor based on the deviation value in the state parameter; and the second adjusting unit is used for dynamically adjusting the load of the server based on the first dynamic adjusting factor and the second dynamic adjusting factor so as to obtain the dynamically adjusted load.
Optionally, in each of the above apparatus embodiments of the present invention, the second adjusting unit is specifically configured to: calculating an average value of the first dynamic adjustment factor and the second dynamic adjustment factor; and taking the product of the load of the server and the average value as the dynamically adjusted load, thereby dynamically adjusting the load of the server.
According to yet another aspect of embodiments of the present invention, there is provided a computer-readable storage medium storing a computer program for executing the method according to any one of the above-mentioned embodiments of the present invention.
According to still another aspect of an embodiment of the present invention, there is provided an electronic apparatus including: a processor; a memory for storing the processor-executable instructions; the processor is configured to read the executable instructions from the memory and execute the instructions to implement the method according to any of the above embodiments of the present invention.
Based on the method and apparatus for performing the stress test on the server based on the dynamic adjustment load, the storage medium and the electronic device provided by the above embodiments of the present invention, when a load (e.g., QPS) bottleneck is encountered during the stress test on the server, the stress test is performed or the stress test on the server is stopped after the load is dynamically adjusted, so as to more accurately test the maximum load or the maximum QPS. The technical scheme of the invention can automatically dynamically adjust the load during pressure testing, automatically learn historical experience, and does not depend on manual experience and does not need manual attendance.
The technical solution of the present invention is further described in detail by the accompanying drawings and embodiments.
Drawings
The above and other objects, features and advantages of the present invention will become more apparent by describing in more detail embodiments of the present invention with reference to the attached drawings. The accompanying drawings are included to provide a further understanding of the embodiments of the invention and are incorporated in and constitute a part of this specification, illustrate embodiments of the invention and together with the description serve to explain the principles of the invention and not to limit the invention. In the drawings, like reference numbers generally represent like parts or steps.
Fig. 1 is a flowchart illustrating a method for stress testing a server based on a dynamic adjustment load according to an exemplary embodiment of the present invention.
Fig. 2 is a flowchart of a method for stress testing a server according to a preset load increase mode according to an exemplary embodiment of the present invention.
Fig. 3 is a flowchart illustrating a method for determining a status parameter of a server according to an exemplary embodiment of the present invention.
Fig. 4 is a flowchart illustrating a method for stress testing a server based on a dynamic adjustment load according to still another exemplary embodiment of the present invention.
Fig. 5 is a schematic structural diagram of an apparatus for stress testing a server based on a dynamic adjustment load according to an exemplary embodiment of the present invention.
Fig. 6 is a structure of an electronic device according to an exemplary embodiment of the present invention.
Detailed Description
Hereinafter, example embodiments according to the present invention will be described in detail with reference to the accompanying drawings. It is to be understood that the described embodiments are merely a subset of embodiments of the invention and not all embodiments of the invention, with the understanding that the invention is not limited to the example embodiments described herein.
It should be noted that: the relative arrangement of the components and steps, the numerical expressions and numerical values set forth in these embodiments do not limit the scope of the present invention unless specifically stated otherwise.
It will be understood by those of skill in the art that the terms "first," "second," and the like in the embodiments of the present invention are used merely to distinguish one element, step, device, module, or the like from another element, and do not denote any particular technical or logical order therebetween.
It should also be understood that in embodiments of the present invention, "a plurality" may refer to two or more and "at least one" may refer to one, two or more.
It is also to be understood that any reference to any component, data, or structure in the embodiments of the invention may be generally understood as one or more, unless explicitly defined otherwise or stated to the contrary hereinafter.
In addition, the term "and/or" in the present invention is only one kind of association relationship describing the associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In the present invention, the character "/" generally indicates that the preceding and following related objects are in an "or" relationship.
It should also be understood that the description of the embodiments of the present invention emphasizes the differences between the embodiments, and the same or similar parts may be referred to each other, so that the descriptions thereof are omitted for brevity.
Meanwhile, it should be understood that the sizes of the respective portions shown in the drawings are not drawn in an actual proportional relationship for the convenience of description.
The following description of at least one exemplary embodiment is merely illustrative in nature and is in no way intended to limit the invention, its application, or uses.
Techniques, methods, and apparatus known to those of ordinary skill in the relevant art may not be discussed in detail, but are intended to be part of the specification where appropriate.
It should be noted that: like reference numbers and letters refer to like items in the following figures, and thus, once an item is defined in one figure, further discussion thereof is not required in subsequent figures.
Embodiments of the invention are operational with numerous other general purpose or special purpose computing system environments or configurations, and with numerous other electronic devices, such as terminal devices, computer systems, servers, etc. Examples of well known terminal devices, computing systems, environments, and/or configurations that may be suitable for use with electronic devices, such as terminal devices, computer systems, servers, and the like, include, but are not limited to: personal computer systems, server computer systems, thin clients, thick clients, hand-held or laptop devices, microprocessor-based systems, set-top boxes, programmable consumer electronics, networked personal computers, minicomputer systems, mainframe computer systems, distributed cloud computing environments that include any of the above, and the like.
Electronic devices such as terminal devices, computer systems, servers, etc. may be described in the general context of computer system-executable instructions, such as program modules, being executed by a computer system. Generally, program modules may include routines, programs, objects, components, logic, data structures, etc. that perform particular tasks or implement particular abstract data types. The computer system/server may be practiced in distributed cloud computing environments where tasks are performed by remote processing devices that are linked through a communications network. In a distributed cloud computing environment, program modules may be located in both local and remote computer system storage media including memory storage devices.
Exemplary method
Fig. 1 is a flowchart illustrating a method for stress testing a server based on a dynamic adjustment load according to an exemplary embodiment of the present invention. The embodiment can be applied to an electronic device, as shown in fig. 1, and includes the following steps:
step 101, detecting the running state of the server in the process of the pressure test to acquire the running state information of the server in the process of the pressure test.
According to one embodiment, the method further comprises the step of performing stress test on the server according to a preset load increase mode when the server does not enter a dynamic test mode capable of dynamically adjusting the load. As shown in fig. 2, the pressure testing the server according to the preset load increase mode includes:
step 201, acquiring a load configuration file, analyzing the load configuration file to acquire an initial target load value, taking the initial target load value as a current target load value, and setting the current load value as 0;
step 202, determining a load increase step length in the current test time period based on the current load value and the current target load value, and performing pressure test on the server in a manner of increasing the load of the server according to the load increase step length in the current test time period;
step 203, acquiring a current operation data set of the server in a current test time period, and determining the matching degree of the current operation data set and a historical operation data set of each test result group in a plurality of test result groups;
step 204, determining at least two related test result groups from the plurality of test result groups based on the matching degree, if yes, performing step 205, and if not, performing step 206;
step 205, when the current testing time period expires, determining an updated target load value according to at least two associated testing result groups, taking the updated target load value as the current target load value and taking the load value when the current testing time period expires as the current load value, and performing step 202;
step 206, determining a load increasing step length based on the current load value and the current target load value, performing a pressure test on the server in a manner of increasing the load of the server according to the load increasing step length, and performing step 207 when detecting that the server cannot continue to perform the pressure test;
and step 207, taking the load value when the server cannot continue the pressure test as the maximum test load value of the pressure test.
In one embodiment, the detecting the operation state of the server in the stress test process comprises the following steps: determining a time cell associated with the stress test; selecting a plurality of time units for operating state detection; and acquiring respective operation data items of the server in the stress test process in each time unit in the plurality of time units. A time unit is a basic length of time for acquiring or detecting a server running a data item. For example, the time unit may be 1 second, 2 seconds, 5 seconds, and the like. The plurality of time units are, for example, 5 time units from 1 st second to 5 th second, 10 time units from 1 st second to 10 th second, or any other reasonable value.
In one embodiment, the obtaining the running state information of the server in the stress test process comprises the following steps: and constituting the operation state information of the server in the stress test process by the respective operation data items in each time unit in the plurality of time units. For example, the operation data items of 5 time units from the 1 st second to the 5 th second constitute the operation state information of the server during the stress test.
In one embodiment, for example, the operational data items include at least the following attributes: average request elapsed time avg, predetermined quantile request elapsed time TPx, minimum request elapsed time min _ cost, request success rate succ _ rate, and request number in time unit QPS. In the case of a time unit of 1 second, during the server stress test, the data of the current second is determined or counted in units of seconds, and the data is reported to a database (for example, mysql database) for storage. The average request elapsed time avg is an average of the length of completion time per request (query request) per unit time. The request elapsed time of the predetermined quantile is a request elapsed time of a predetermined quantile that all requests are sorted in ascending order of the completion time lengths of the requests (for example, from 1 msec to 965 msec), and the completion time length of the request sorted at the predetermined position is taken as the request elapsed time of the predetermined quantile. For example, the memory completes 100 requests per unit time, the 100 requests are sorted in ascending order of completion time length, and the completion time length of the request ranked at the 90 th bit is taken as the time taken for the request of 90 deciles per cent TP 90. It should be appreciated that the predetermined quantile may be any reasonable quantile, such as 80 percent quantile, 90 percent quantile, and so on. The minimum request time is a completion time length of a request having the minimum completion time length among requests completed in a unit time, for example, 1 millisecond. The request success rate is a percentile of the number of requests successfully processed by the server per unit time, for example, the number of requests successfully processed by the server per unit time S1 and the number of requests failed to be processed by the server per unit time S2, and the request success rate is S1/(S1 + S2). The number of requests in a time unit is the QPS, i.e., the number of requests or the number of transactions, in the time unit. It should be appreciated that during the server stress test, the operational data items of the server are recorded for each time unit.
And 102, processing the running state information to acquire state parameters of the server, and enabling the server to enter a dynamic test mode capable of dynamically adjusting the load when the server is determined to be in a load early warning state based on the state parameters.
In one embodiment, wherein processing the running state information to obtain the state parameters of the server comprises: extracting a respective operation data item for each of a plurality of time units from the operation state information; at least one key attribute is selected from a plurality of attributes of the operational data item. As described above, the attributes may include an average request elapsed time, a predetermined quantile of request elapsed time, a minimum request elapsed time, a request success rate, and a number of requests within a time unit. At least one key attribute refers to an attribute that can affect the server state determination. For example, the key attributes are average request time consumption and request success rate. In the actual determination, a key attribute may be selected for determination, and then the selected key attribute is the target key attribute for determining the server status. The operation data items refer to operation data of the server in each time unit, and each operation data item corresponds to one time unit.
For example, the average request elapsed time or the request success rate is selected from the average request elapsed time, the request elapsed time of a predetermined bit, the minimum request elapsed time, the request success rate, and the number of requests in a time unit as the key attribute. A state parameter of the server is determined based on the at least one key attribute. For example, the average of the average request elapsed times per second (per time unit) within 5 seconds (5 time units) is used as the key attribute of the average request elapsed time. Alternatively, the average value of the request success rate per second (per time unit) within 5 seconds (5 time units) is used as the key attribute when the success rate is requested.
In another embodiment, the average request elapsed time and the request success rate are selected as key attributes from the average request elapsed time, the predetermined quantile of request elapsed time, the minimum request elapsed time, the request success rate, and the number of requests in a time unit. For example, an average value of the average request elapsed time per second (per time unit) within 5 seconds (5 time units) is taken as a key attribute of the average request elapsed time, and an average value of the request success rate per second (per time unit) within 5 seconds (5 time units) is taken as a key attribute of the request success rate.
In one embodiment, before processing the running state information, the average request elapsed time within 5 seconds (5 time units), the predetermined fraction of request elapsed time, the minimum request elapsed time, the request success rate, and the number of requests within a time unit may also be checked to obtain checked data.
In one embodiment, after processing the running state information to obtain the state parameter of the server, the method further includes: determining an operating state of the server based on the state parameters, the operating state comprising: a load early warning state, a load normal state and an operation early warning state. When the server is determined to be in a normal load state based on the state parameters, the server does not enter a dynamic test mode capable of dynamically adjusting the load; or when the server is determined to be in the operation early warning state based on the state parameters, stopping pressure testing on the server, and uploading the operation state information of the server in the pressure testing process to the log server.
For example, when the key attribute is a request success rate, when the request success rate is greater than or equal to a first success rate threshold (e.g., 80%), the operation state is determined to be a load normal state; when the request success rate is less than a first power forming threshold (for example, 80%) and greater than or equal to a second power forming threshold (for example, 60%), determining the operation state as a load early warning state; when the request success rate is less than a second power consumption threshold (e.g., 60%), the operation state is determined to be an operation early warning state.
In another example, when the key attribute is an average request elapsed time, when the average request elapsed time is less than or equal to a first elapsed time threshold (e.g., 500 ms), the operating state is determined to be a load normal state; when the average request time is greater than a first power consumption threshold (for example, 500 ms) and less than or equal to a second power consumption threshold (for example, 1000 ms), determining that the operation state is a load early warning state; when the average requested elapsed time is greater than a second power threshold (e.g., 1000 ms), the operational state is determined to be an operational pre-warning state.
In another example, when the key attributes are a request success rate and an average request consumption rate, when the request success rate is greater than or equal to a first success rate threshold (e.g., 80%) and the average request consumption rate is less than or equal to a first consumption rate threshold (e.g., 500 ms), the operation state is determined to be a load normal state. When the request success rate is less than a first success rate threshold (e.g., 80%) and greater than or equal to a second success rate threshold (e.g., 60%), and when the average request elapsed time is greater than the first success rate threshold (e.g., 500 ms) and less than or equal to the second success rate threshold (e.g., 1000 ms), the operation state is determined to be a load warning state. When the request success rate is less than a second power consumption threshold (e.g., 60%), and when the average request elapsed time is greater than the second power consumption threshold (e.g., 1000 ms), the operation state is determined to be the operation warning state.
Step 103, in the dynamic test mode, a pressure test is performed on the server in a manner of dynamically adjusting the load based on the state parameter. In order to determine the monitoring time of the load early warning state, when the server enters a dynamic test mode capable of dynamically adjusting the load, the current time is recorded as the detection time of the load early warning state.
In one embodiment, stress testing the server in a manner that dynamically adjusts the load based on the state parameters includes: and in a first preset time period from the detection time of the load early warning state, carrying out stress test on the server by using the current load when the server enters a dynamic test mode. For example, within 30 seconds from the detection time of the load warning state, the stress test is performed by the QPS (e.g., 800 QPS) when the server enters the dynamic test mode.
In one embodiment, the method further comprises detecting the running state of the server entering the dynamic test mode to acquire the respective running data item in each of the plurality of time units in the first predetermined time period. In the present invention, a plurality of time cells may be selected from all time cells of the first predetermined period. For example, 10 time units (i.e., 10 seconds) are selected at 30 time units (e.g., 30 seconds).
In one embodiment, the method further comprises performing data fitting on a plurality of running data items of the server for a plurality of time units within a first predetermined time period based on the initial fitting parameters to generate a server state curve. For example, the plurality of operational data items may be data-fitted using any suitable algorithm, such as a polynomial regression algorithm, to generate the server state curve. The polynomial regression algorithm belongs to the supervised regression learning algorithm. By establishing a regression model between variables, the polynomial regression algorithm obtains the correlation between the variables and the dependent variables based on a learning (training) process. Common polynomial regression algorithms include: linear regression algorithms, non-linear regression algorithms, logistic regression algorithms, etc.
The initial fitting parameters are empirical coefficients, multiple sets of running data can be obtained by performing multiple server pressure test tests in advance through manual operation, and parameter adjustment is performed based on results of the multiple sets of running data until appropriate parameters are obtained. For example, when it is determined that the server is in a steady state, the server state curve obtained by the current fitting parameters is in a smooth state, and then the current fitting parameters may be used as the initial fitting parameters.
In one embodiment, for example, from the recorded load warning time to all data items in the current time (average request elapsed time, predetermined quantile request elapsed time, minimum request elapsed time, request success rate, and number of requests in time unit), a polynomial regression algorithm is used to fit a curve.
In one embodiment, after generating the server state curve, determining whether the server state curve has trend jitter; and if the trend jitter exists, adjusting the fitting parameters and performing data fitting on a plurality of operation data items of a plurality of time units in the first preset time period of the server by using a polynomial regression algorithm based on the adjusted fitting parameters until the server state curve does not have the trend jitter.
Specifically, whether the server state curve has trend jitter or not may be determined based on the slope and the smoothness of the fitted server state curve. For example, values corresponding to time units at intervals of a preset time may be compared, and when a curve formed by values corresponding to a plurality of consecutive time units changes frequently and irregularly, a condition that the curve formed by the values corresponding to the plurality of consecutive time units is not smooth is determined, and it is determined that the server state curve has a trend jitter, so that the fitting parameters need to be adjusted to obtain the corrected server state curve.
According to the scheme provided by the embodiment of the invention, the trend state of the server can be determined according to the server state curve. Wherein the trend state comprises: toward a healthy state and toward a deteriorated state. For example, the slope of the line segment connecting the last two nodes of the fitted curve is determined, and the current trend is judged according to the slope. If the slope is negative, the server state tends to be a deteriorated state; if the slope is zero, the server state is also driven to a deterioration state; if the slope is positive, the server state goes to a healthy state.
In one embodiment, when the trend state of the server is a trend worsening state, the load of the server may be dynamically adjusted based on the state parameter to obtain a dynamically adjusted load. And then carrying out pressure test on the server by using the dynamically adjusted load until the trend state of the server is towards a healthy state.
According to one embodiment, when the server state tends to the degraded state, the load of the server may also be dynamically adjusted to 80% of the current load to obtain a dynamically adjusted load.
In one embodiment, the server is stress tested at a dynamically adjusted load for a second predetermined period of time as the state of the server trends toward a healthy state. For example, the server is stressed with a dynamically adjusted load for 60 seconds. And detecting the running state of the server within a second preset time period to acquire the running state information of the server within the second preset time period. And processing the running state information in the second preset time period to acquire the state parameters in the second preset time period. And when the server is determined to be in the load normal state based on the state parameters in the second preset time period, the server is quitted from the dynamic test mode capable of dynamically adjusting the load. That is, after the server is restored to the normal load state in the dynamic test mode, the dynamic test module may be exited, and the normal test mode may be returned, that is, the server is subjected to the stress test according to the preset load increase mode.
In one embodiment, after the server is caused to exit the dynamic test mode capable of dynamically adjusting the load, determining whether a test time period for stress testing the server expires, and if so, stopping stress testing the server; if not, continuing to stress the server. For example, the test period may be any reasonable value such as 3 hours, 5 hours, etc.
In one embodiment, in order to be able to dynamically adjust the load of the server based on the state parameters, the present invention needs to determine the state parameters of the server. Fig. 3 is a flowchart illustrating a method for determining a status parameter of a server according to an exemplary embodiment of the present invention. As shown in fig. 3, the method for determining the state parameter of the server based on at least one key attribute includes:
step 301, determining a target key attribute from at least one key attribute.
Step 302, obtaining a plurality of attribute values of the target key attribute, and determining a server operation parameter based on the plurality of attribute values. The server operation parameter is characterized by a plurality of attribute values, and the server operation parameter is determined by a plurality of attribute values. For example, the server operation parameter is an average value of a plurality of attribute values.
Step 303, obtain a first threshold and a second threshold associated with the target key attribute.
Step 304, determining a state parameter of the server according to the server operation parameter, the first threshold value and the second threshold value.
In one embodiment, determining the state parameter of the server based on the server operating parameter, the first threshold, and the second threshold comprises: when the server operation parameter is larger than or equal to the first threshold value, determining that the state value of the state parameter of the server is normal and the deviation value is null; when the server operation parameter is smaller than a first threshold and larger than or equal to a second threshold, determining that the state value of the state parameter of the server is a load early warning and the deviation value is the ratio of the server operation parameter to the first threshold; and when the server operation parameter is smaller than the second threshold value, determining that the state value of the state parameter of the server is operation early warning and the deviation value is null. Wherein the state parameters include: state values and offset values. The deviation value represents the difference degree between the server operation parameter and the threshold value. When the state value of the state parameter of the server is load-normal, the subsequent processing is not concerned at this time regardless of the degree of difference, and therefore, the offset value is set to null in this case to indicate that the offset value field is not required to be used.
Referring to the above example, when the key attribute is the request success rate, when the request success rate is greater than or equal to the first success rate threshold (e.g., 80%), the operation state is determined to be the load normal state; when the request success rate is less than a first power forming threshold (for example, 80%) and greater than or equal to a second power forming threshold (for example, 60%), determining the operation state as a load early warning state; when the request success rate is less than a second power consumption threshold (e.g., 60%), the operation state is determined to be an operation early warning state.
In one embodiment, alternatively, determining the state parameter of the server based on the server operating parameter, the first threshold, and the second threshold comprises: when the server operation parameter is smaller than or equal to the first threshold value, determining that the state value of the state parameter of the server is normal and the deviation value is null; when the server operation parameter is larger than the first threshold and smaller than or equal to the second threshold, determining that the state value of the state parameter of the server is a load early warning and the deviation value is the ratio of the server operation parameter to the second threshold; and when the server operation parameter is larger than the second threshold value, determining that the state value of the state parameter of the server is operation early warning and the deviation value is null. Referring to the above example, when the key attribute is the average request elapsed time, when the average request elapsed time is less than or equal to the first elapsed time threshold (e.g., 500 ms), the operation state is determined to be the load normal state; when the average request time is greater than a first power consumption threshold (for example, 500 ms) and less than or equal to a second power consumption threshold (for example, 1000 ms), determining that the operation state is a load early warning state; when the average requested elapsed time is greater than a second power threshold (e.g., 1000 ms), the operational state is determined to be an operational pre-warning state.
In one embodiment, wherein dynamically adjusting the load of the server based on the state parameter to obtain a dynamically adjusted load comprises: acquiring a first dynamic adjustment factor from a configuration file of a server; determining a second dynamic adjustment factor based on the deviation value in the state parameter; and dynamically adjusting the load of the server based on the first dynamic adjustment factor and the second dynamic adjustment factor to obtain the dynamically adjusted load. Wherein dynamically adjusting the load of the server based on the first dynamic adjustment factor and the second dynamic adjustment factor to obtain a dynamically adjusted load comprises: calculating an average value of the first dynamic adjustment factor and the second dynamic adjustment factor; and taking the product of the load of the server and the average value as the dynamically adjusted load. For example, when the average value of the first dynamic adjustment factor and the second dynamic adjustment factor is 80%, the product obtained by multiplying the load of the server by 80% is used as the dynamically adjusted load.
Fig. 4 is a flowchart illustrating a method for stress testing a server based on a dynamic adjustment load according to still another exemplary embodiment of the present invention. In the embodiment of the invention, the state of the server is judged according to the average request time consumption and/or the request success rate. And when the state of the server is determined to be the load early warning state, reducing the QPS and observing the preset time. In the load warning state, the request success rate and the average request elapsed time from the alarm time point to the current time are fitted to generate a polynomial curve using various suitable algorithms such as a polynomial regression algorithm. If the slope of the polynomial curve is negative or zero, the state of the server tends to be a deteriorated state, and the QPS needs to be reduced; and if the slope of the polynomial curve is positive, the state of the server tends to be in a deteriorated state, the conventional pressure test mode is recovered after a certain time of continuous observation, and the pressure test according to a preset load increasing mode is carried out.
As shown in fig. 4, the method for stress testing a server based on a dynamic adjustment load includes:
step 401, a stress test function is called to prepare for stress testing of a server.
Step 402, creating a current test task for the stress test and setting a task identifier ID.
In step 403, it is determined whether there are other tasks having the same task identity as the task identity of the current test task. If so, go to step 404; if not, go to step 405.
Step 404, the existing test thread is closed and a new test thread is started.
Step 405, determining whether the test time expires, if so, performing step 418, and stopping performing the pressure test on the server; if not, step 406 is performed.
Step 406, determining the running state of the server, and when the running state of the server is a load normal state, performing step 407; when the running state of the server is the load early warning state, performing step 411; when the operation status of the server is the operation early warning status, step 416 is performed.
Step 407, performing a pressure test on the server according to the non-dynamic test mode;
at step 408, it is determined whether it is in the last test period. If not, then go to step 409, continue the pressure test according to the target load value; if so, then step 410 is performed to perform a pressure test according to the load increase step determined by the last predicted target load value. In one embodiment, after step 409 or 410, step 405 may continue.
In step 411, the server enters a dynamic test mode in which the load can be dynamically adjusted.
Step 412, determining whether the server enters a dynamic test mode capable of dynamically adjusting the load for the first time, if so, performing step 413, otherwise, performing step 414.
Step 413, dynamically adjusting the load of the server to obtain a dynamically adjusted load, and step 415 is performed.
At step 414, it is determined whether the operating state of the server is healthy. If so, go to step 405; if not, step 413 is performed.
Step 415 determines whether the operational state of the server is healthy. If so, go to step 405; if not, step 418 is performed.
Step 416, stop stress testing the server.
And step 417, uploading the running state information of the server.
Exemplary devices
Fig. 5 is a schematic structural diagram of an apparatus for stress testing a server based on a dynamic adjustment load according to an exemplary embodiment of the present invention. As shown in fig. 5, the present embodiment includes:
the detecting module 51 is configured to perform operation state detection on the server in the process of the stress test to obtain operation state information of the server in the process of the stress test.
And the control module 52 is configured to process the running state information to obtain a state parameter of the server, and when it is determined that the server is in a load early warning state based on the state parameter, enable the server to enter a dynamic test mode capable of dynamically adjusting a load.
And the test module 53 is configured to perform a stress test on the server in a dynamic test mode in a manner of dynamically adjusting the load based on the state parameter.
In an embodiment, the testing module 53 is further configured to perform a stress test on the server according to a preset load increase mode when the server does not enter a dynamic testing mode capable of dynamically adjusting the load.
In one embodiment, the detection module 51 includes: a first determination unit for determining a time unit associated with the stress test; a first selection unit for selecting a plurality of time units for operation state detection; the first acquisition unit is used for acquiring the respective operation data items of the server in the stress test process in each time unit of the plurality of time units.
In an embodiment, the detecting module 51 is further configured to construct the respective operation data item in each time unit of the plurality of time units as the operation status information of the server during the stress test.
In one embodiment, wherein the run data item includes the following attributes: average request elapsed time, predetermined quantile request elapsed time, minimum request elapsed time, request success rate, and number of requests in a time unit.
In one embodiment, the control module 52 includes: an extraction unit configured to extract, from the operation state information, an operation data item for each of the plurality of time units; a second selecting unit for selecting at least one key attribute from the plurality of attributes of the run data item;
a second determining unit for determining a state parameter of the server based on the at least one key attribute.
In one embodiment, the control module 52 is further configured to determine an operating state of the server based on the state parameter, the operating state including: a load early warning state, a load normal state and an operation early warning state.
In one embodiment, the control module 52 is further configured to not enter a dynamic test mode capable of dynamically adjusting the load when the server is determined to be in a normal load state based on the state parameter.
In an embodiment, the control module 52 is further configured to stop the stress test on the server when it is determined that the server is in the operation warning state based on the state parameter, and upload the operation state information of the server in the stress test process to the log server.
In an embodiment, the control module 52 is further configured to record the current time as the detection time of the load warning state when the server enters the dynamic test mode capable of dynamically adjusting the load.
In an embodiment, the testing module 53 is specifically configured to perform a stress test on the server with the current load when the server enters the dynamic testing mode within a first predetermined time period from the detection time of the load warning state.
In an embodiment, the test module 53 is further configured to perform an operation status check on the server entering the dynamic test mode to obtain a respective operation data item in each of a plurality of time units of the server within the first predetermined time period.
In an embodiment, the test module 53 is further configured to perform data fitting on a plurality of operation data items of the server in a plurality of time units within the first predetermined time period based on the initial fitting parameters to generate the server state curve.
In one embodiment, the test module 53 further comprises: a third determining unit, configured to determine whether a trend jitter exists in the server state curve; and the first adjusting unit is used for adjusting the fitting parameters and performing data fitting on a plurality of running data items of a plurality of time units of the server within a first preset time period on the basis of the adjusted fitting parameters until the server state curve has no trend jitter.
In one embodiment, the test module 53 is further configured to determine a trend state of the server according to the server state curve, where the trend state includes: toward a healthy state and toward a deteriorated state.
In one embodiment, the test module 53 is further configured to, when the trend state of the server is a trend worsening state, dynamically adjust the load of the server based on the state parameter to obtain a dynamically adjusted load; and carrying out stress test on the server with the dynamically adjusted load until the trend state of the server is towards the healthy state.
In one embodiment, the testing module 53 is further configured to perform a stress test on the server with the dynamically adjusted load for a second predetermined time period when the trend state of the server is towards the healthy state.
The detection module 51 is further configured to perform operation status detection on the server within a second predetermined time period to obtain operation status information of the server within the second predetermined time period.
In an embodiment, the control module 52 is further configured to process the running state information in the second predetermined time period to obtain the state parameter in the second predetermined time period; and when the server is determined to be in the load normal state based on the state parameters in the second preset time period, the server is quitted from the dynamic test mode capable of dynamically adjusting the load.
In one embodiment, the test module 53 is further configured to determine whether a test time period for performing the stress test on the server expires after the server is exited from the dynamic test mode capable of dynamically adjusting the load, and if the test time period expires, stop performing the stress test on the server; if not, continuing to stress the server.
In one embodiment, the control module 52 further includes: a fourth determining unit, configured to determine a target key attribute from the at least one key attribute; the second acquisition unit is used for acquiring a plurality of attribute values of the target key attribute and determining the operation parameters of the server based on the attribute values; a third acquiring unit, configured to acquire a first threshold and a second threshold associated with the target key attribute; and the fifth determining unit is used for determining the state parameter of the server according to the server operation parameter, the first threshold and the second threshold.
Optionally, in each of the apparatus embodiments of the present invention, the fifth determining unit is specifically configured to: when the server operation parameter is larger than or equal to the first threshold value, determining that the state value of the state parameter of the server is normal and the deviation value is null; when the server operation parameter is smaller than a first threshold and larger than or equal to a second threshold, determining that the state value of the state parameter of the server is a load early warning and the deviation value is the ratio of the server operation parameter to the first threshold; when the server operation parameter is smaller than a second threshold value, determining that the state value of the state parameter of the server is operation early warning and the deviation value is null; wherein the state parameters include: state values and offset values.
In one embodiment, the test module 53 further comprises: the fourth acquisition unit is used for acquiring the first dynamic adjustment factor from the configuration file of the server; a sixth determining unit for determining a second dynamic adjustment factor based on the deviation value in the state parameter; and the second adjusting unit is used for dynamically adjusting the load of the server based on the first dynamic adjusting factor and the second dynamic adjusting factor so as to obtain the dynamically adjusted load.
In an embodiment, the second adjusting unit is specifically configured to: calculating an average value of the first dynamic adjustment factor and the second dynamic adjustment factor; and taking the product of the load of the server and the average value as the dynamically adjusted load, thereby dynamically adjusting the load of the server.
Exemplary electronic device
Fig. 6 is a structure of an electronic device 60 according to an exemplary embodiment of the present invention. The electronic device 60 may be either or both of the first device and the second device, or a stand-alone device separate from them that may communicate with the first device and the second device to receive the acquired input signals therefrom. Fig. 6 illustrates a block diagram of an electronic device 60 in accordance with an embodiment of the disclosure. As shown in fig. 6, the electronic device 60 includes one or more processors 61 and a memory 62.
The processor 61 may be a Central Processing Unit (CPU) or other form of processing unit having data processing capabilities and/or instruction execution capabilities, and may control other components in the electronic device 60 to perform desired functions.
Memory 62 may include one or more computer program products that may include various forms of computer-readable storage media, such as volatile memory and/or non-volatile memory. The volatile memory may include, for example, Random Access Memory (RAM), cache memory (cache), and/or the like. The non-volatile memory may include, for example, Read Only Memory (ROM), hard disk, flash memory, etc. One or more computer program instructions may be stored on the computer-readable storage medium and executed by the processor 61 to implement the method of stress testing a server based on dynamically adjusted loads of the software program of the various embodiments of the present disclosure described above and/or other desired functions. In one example, the electronic device 60 may further include: an input device 63 and an output device 64, which are interconnected by a bus system and/or other form of connection mechanism (not shown).
The input device 63 may also include, for example, a keyboard, a mouse, and the like.
The output device 64 can output various information to the outside. The output devices 64 may include, for example, a display, speakers, a printer, and a communication network and remote output devices connected thereto, among others.
Of course, for simplicity, only some of the components of the electronic device 60 relevant to the present disclosure are shown in fig. 6, omitting components such as buses, input/output interfaces, and the like. In addition, the electronic device 60 may include any other suitable components depending on the particular application.
Exemplary computer program product and computer-readable storage Medium
In addition to the above-described methods and apparatus, embodiments of the present disclosure may also be a computer program product comprising computer program instructions that, when executed by a processor, cause the processor to perform the steps in a method of stress testing a server based on dynamically adjusted loads according to various embodiments of the present disclosure described in the "exemplary methods" section above of this specification.
The computer program product may write program code for carrying out operations for embodiments of the present disclosure in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user's computing device, partly on the user's device, as a stand-alone software package, partly on the user's computing device and partly on a remote computing device, or entirely on the remote computing device or server.
Furthermore, embodiments of the present disclosure may also be a computer-readable storage medium having stored thereon computer program instructions that, when executed by a processor, cause the processor to perform the steps in the method of stress testing a server based on dynamically adjusted loads according to various embodiments of the present disclosure described in the "exemplary methods" section above in this specification.
The computer-readable storage medium may take any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may include, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or a combination of any of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The foregoing describes the general principles of the present disclosure in conjunction with specific embodiments, however, it is noted that the advantages, effects, etc. mentioned in the present disclosure are merely examples and are not limiting, and they should not be considered essential to the various embodiments of the present disclosure. Furthermore, the foregoing disclosure of specific details is for the purpose of illustration and description and is not intended to be limiting, since the disclosure is not intended to be limited to the specific details so described.
In the present specification, the embodiments are described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same or similar parts in the embodiments are referred to each other. For the system embodiment, since it basically corresponds to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The block diagrams of devices, apparatuses, systems referred to in this disclosure are only given as illustrative examples and are not intended to require or imply that the connections, arrangements, configurations, etc. must be made in the manner shown in the block diagrams. These devices, apparatuses, devices, systems may be connected, arranged, configured in any manner, as will be appreciated by those skilled in the art. Words such as "including," "comprising," "having," and the like are open-ended words that mean "including, but not limited to," and are used interchangeably therewith. The words "or" and "as used herein mean, and are used interchangeably with, the word" and/or, "unless the context clearly dictates otherwise. The word "such as" is used herein to mean, and is used interchangeably with, the phrase "such as but not limited to".
The methods and apparatus of the present disclosure may be implemented in a number of ways. For example, the methods and apparatus of the present disclosure may be implemented by software, hardware, firmware, or any combination of software, hardware, and firmware. The above-described order for the steps of the method is for illustration only, and the steps of the method of the present disclosure are not limited to the order specifically described above unless specifically stated otherwise. Further, in some embodiments, the present disclosure may also be embodied as programs recorded in a recording medium, the programs including machine-readable instructions for implementing the methods according to the present disclosure. Thus, the present disclosure also covers a recording medium storing a program for executing the method according to the present disclosure.
It is also noted that in the devices, apparatuses, and methods of the present disclosure, each component or step can be decomposed and/or recombined. These decompositions and/or recombinations are to be considered equivalents of the present disclosure. The previous description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the generic principles defined herein may be applied to other aspects without departing from the scope of the disclosure. Thus, the present disclosure is not intended to be limited to the aspects shown herein but is to be accorded the widest scope consistent with the principles and novel features disclosed herein.
The foregoing description has been presented for purposes of illustration and description. Furthermore, this description is not intended to limit embodiments of the disclosure to the form disclosed herein. While a number of example aspects and embodiments have been discussed above, those of skill in the art will recognize certain variations, modifications, alterations, additions and sub-combinations thereof.

Claims (24)

1. A method for stress testing a server based on dynamically adjusting load is characterized by comprising the following steps:
detecting the running state of the server in the pressure testing process to acquire the running state information of the server in the pressure testing process;
processing the running state information to obtain state parameters of the server, and enabling the server to enter a dynamic test mode capable of dynamically adjusting the load when the server is determined to be in a load early warning state based on the state parameters; and
in the dynamic test mode, the server is subjected to a stress test in such a manner that the load is dynamically adjusted based on the state parameters.
2. The method of claim 1, further comprising, when the server does not enter a dynamic test mode capable of dynamically adjusting the load, performing a stress test on the server according to a preset load increase mode.
3. The method of claim 1, wherein the detecting the operational status of the server under stress test comprises:
determining a time cell associated with the stress test;
selecting a plurality of time units for operating state detection;
and acquiring respective operation data items of the server in the stress test process in each time unit in the plurality of time units.
4. The method of claim 3, wherein obtaining the operating status information of the server during the stress test comprises:
and constituting the operation state information of the server in the stress test process by the respective operation data items in each time unit in the plurality of time units.
5. The method of claim 3 or 4, wherein the run data items comprise the following attributes: average request elapsed time, predetermined quantile request elapsed time, minimum request elapsed time, request success rate, and number of requests in a time unit.
6. The method of claim 1, wherein processing the operating state information to obtain the state parameters of the server comprises:
extracting a respective operation data item for each of a plurality of time units from the operation state information;
selecting at least one key attribute from a plurality of attributes of the operational data item;
a state parameter of the server is determined based on the at least one key attribute.
7. The method of claim 1, wherein processing the running state information to obtain the state parameters of the server further comprises:
determining an operating state of the server based on the state parameters, the operating state comprising: a load early warning state, a load normal state and an operation early warning state.
8. The method of claim 7, wherein when the server is determined to be in a normal load state based on the state parameters, the server does not enter a dynamic test mode in which the load can be dynamically adjusted; or
And when the server is determined to be in the operation early warning state based on the state parameters, stopping pressure testing on the server, and uploading the operation state information of the server in the pressure testing process to the log server.
9. The method of claim 1, wherein when the server enters a dynamic test mode capable of dynamically adjusting the load, a current time is recorded as a detection time of the load warning state.
10. The method of claim 9, wherein stress testing the server in a manner that dynamically adjusts the load based on the state parameter comprises: and in a first preset time period from the detection time of the load early warning state, carrying out stress test on the server by using the current load when the server enters a dynamic test mode.
11. The method of claim 10, further comprising performing an operational status check on the server entering the dynamic test mode to obtain respective operational data items for the server in each of the plurality of time units during the first predetermined time period.
12. The method of claim 11, further comprising data fitting a plurality of operational data items for a plurality of time units of the server over a first predetermined time period based on the initial fit parameters to generate a server state curve.
13. The method of claim 12, further comprising, after generating the server state curve:
determining whether the server state curve has trend jitter;
and if the trend jitter exists, adjusting the fitting parameters and performing data fitting on a plurality of operation data items of a plurality of time units of the server within a first preset time period based on the adjusted fitting parameters until the server state curve does not have the trend jitter.
14. The method of claim 13, further comprising determining a trend state of the server from a server state curve, the trend state comprising: toward a healthy state and toward a deteriorated state.
15. The method of claim 14, wherein when the trend state of the server is a trend worsening state, the load of the server is dynamically adjusted based on the state parameter to obtain a dynamically adjusted load;
and carrying out stress test on the server with the dynamically adjusted load until the trend state of the server is towards the healthy state.
16. The method according to claim 14 or 15, wherein when the trend state of the server is a trend toward healthy state, the server is stress tested with a dynamically adjusted load for a second predetermined period of time;
detecting the running state of the server within a second preset time period to acquire the running state information of the server within the second preset time period;
processing the running state information in the second preset time period to acquire state parameters in the second preset time period;
and when the server is determined to be in the load normal state based on the state parameters in the second preset time period, the server is quitted from the dynamic test mode capable of dynamically adjusting the load.
17. The method of claim 16, wherein after exiting the server from the dynamic test mode capable of dynamically adjusting the load, determining whether a test time period for stress testing the server has expired, and if so, ceasing stress testing the server; if not, continuing to stress the server.
18. The method of claim 6, wherein determining the state parameter of the server based on the at least one key attribute comprises:
determining a target key attribute from the at least one key attribute;
acquiring a plurality of attribute values of a target key attribute, and determining a server operation parameter based on the attribute values;
acquiring a first threshold value and a second threshold value which are associated with a target key attribute;
and determining the state parameter of the server according to the server operation parameter, the first threshold value and the second threshold value.
19. The method of claim 18, wherein determining the state parameter of the server based on the server operational parameter, the first threshold, and the second threshold comprises:
when the server operation parameter is larger than or equal to the first threshold value, determining that the state value of the state parameter of the server is normal and the deviation value is null;
when the server operation parameter is smaller than a first threshold and larger than or equal to a second threshold, determining that the state value of the state parameter of the server is a load early warning and the deviation value is the ratio of the server operation parameter to the first threshold;
when the server operation parameter is smaller than a second threshold value, determining that the state value of the state parameter of the server is operation early warning and the deviation value is null;
wherein the state parameters include: state values and offset values.
20. The method of claim 15, wherein dynamically adjusting the load on the server based on the state parameter to obtain the dynamically adjusted load comprises:
acquiring a first dynamic adjustment factor from a configuration file of a server;
determining a second dynamic adjustment factor based on the deviation value in the state parameter;
and dynamically adjusting the load of the server based on the first dynamic adjustment factor and the second dynamic adjustment factor to obtain the dynamically adjusted load.
21. The method of claim 20, wherein dynamically adjusting the load on the server based on the first dynamic adjustment factor and the second dynamic adjustment factor to obtain the dynamically adjusted load comprises:
calculating an average value of the first dynamic adjustment factor and the second dynamic adjustment factor;
and taking the product of the load of the server and the average value as the dynamically adjusted load, thereby dynamically adjusting the load of the server.
22. An apparatus for stress testing a server based on dynamically adjusting a load, comprising:
the detection module is used for detecting the running state of the server in the pressure test process so as to acquire the running state information of the server in the pressure test process;
the control module is used for processing the running state information to obtain the state parameters of the server, and when the server is determined to be in a load early warning state based on the state parameters, the server enters a dynamic test mode capable of dynamically adjusting the load; and
and the test module is used for carrying out pressure test on the server in a mode of dynamically adjusting the load based on the state parameters in the dynamic test mode.
23. A computer-readable storage medium, characterized in that the storage medium stores a computer program for performing the method of any of the preceding claims 1-21.
24. An electronic device, characterized in that the electronic device comprises:
a processor;
a memory for storing the processor-executable instructions;
the processor is configured to read the executable instructions from the memory and execute the instructions to implement the method of any of claims 1-21.
CN202110894162.4A 2021-08-05 2021-08-05 Method and device for carrying out pressure test on server based on dynamic adjustment load Active CN113342588B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110894162.4A CN113342588B (en) 2021-08-05 2021-08-05 Method and device for carrying out pressure test on server based on dynamic adjustment load

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110894162.4A CN113342588B (en) 2021-08-05 2021-08-05 Method and device for carrying out pressure test on server based on dynamic adjustment load

Publications (2)

Publication Number Publication Date
CN113342588A true CN113342588A (en) 2021-09-03
CN113342588B CN113342588B (en) 2021-11-19

Family

ID=77480844

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110894162.4A Active CN113342588B (en) 2021-08-05 2021-08-05 Method and device for carrying out pressure test on server based on dynamic adjustment load

Country Status (1)

Country Link
CN (1) CN113342588B (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113900915A (en) * 2021-09-28 2022-01-07 盐城金堤科技有限公司 Method and device for determining service performance state, storage medium and electronic equipment
CN113905091A (en) * 2021-09-15 2022-01-07 盐城金堤科技有限公司 Method and device for processing access request

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102063354A (en) * 2009-11-18 2011-05-18 英业达股份有限公司 Pressure test method of server
CN109542777A (en) * 2018-11-07 2019-03-29 北京搜狗科技发展有限公司 A kind of method for testing pressure, device and readable medium
CN109542746A (en) * 2018-11-23 2019-03-29 北京车和家信息技术有限公司 Method for testing pressure, system and server stress test macro
US20190182129A1 (en) * 2017-12-11 2019-06-13 Spirent Communications, Inc. Method and system for inducing pseudo https communications between one or more emulated servers and emulated clients to test a device therebetween
CN111159009A (en) * 2019-11-29 2020-05-15 深圳智链物联科技有限公司 Pressure testing method and device for log service system
CN112350878A (en) * 2019-08-07 2021-02-09 阿里巴巴集团控股有限公司 Pressure test system

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102063354A (en) * 2009-11-18 2011-05-18 英业达股份有限公司 Pressure test method of server
US20190182129A1 (en) * 2017-12-11 2019-06-13 Spirent Communications, Inc. Method and system for inducing pseudo https communications between one or more emulated servers and emulated clients to test a device therebetween
CN109542777A (en) * 2018-11-07 2019-03-29 北京搜狗科技发展有限公司 A kind of method for testing pressure, device and readable medium
CN109542746A (en) * 2018-11-23 2019-03-29 北京车和家信息技术有限公司 Method for testing pressure, system and server stress test macro
CN112350878A (en) * 2019-08-07 2021-02-09 阿里巴巴集团控股有限公司 Pressure test system
CN111159009A (en) * 2019-11-29 2020-05-15 深圳智链物联科技有限公司 Pressure testing method and device for log service system

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113905091A (en) * 2021-09-15 2022-01-07 盐城金堤科技有限公司 Method and device for processing access request
CN113905091B (en) * 2021-09-15 2023-09-01 盐城天眼察微科技有限公司 Method and device for processing access request
CN113900915A (en) * 2021-09-28 2022-01-07 盐城金堤科技有限公司 Method and device for determining service performance state, storage medium and electronic equipment
CN113900915B (en) * 2021-09-28 2024-03-08 盐城天眼察微科技有限公司 Method and device for determining service performance state, storage medium and electronic equipment

Also Published As

Publication number Publication date
CN113342588B (en) 2021-11-19

Similar Documents

Publication Publication Date Title
CN109815084B (en) Abnormity identification method and device, electronic equipment and storage medium
WO2022068645A1 (en) Database fault discovery method, apparatus, electronic device, and storage medium
KR102522005B1 (en) Apparatus for VNF Anomaly Detection based on Machine Learning for Virtual Network Management and a method thereof
CN113342588B (en) Method and device for carrying out pressure test on server based on dynamic adjustment load
CN111045894B (en) Database abnormality detection method, database abnormality detection device, computer device and storage medium
CN111459778A (en) Operation and maintenance system abnormal index detection model optimization method and device and storage medium
US8516499B2 (en) Assistance in performing action responsive to detected event
CN110572297B (en) Network performance evaluation method, server and storage medium
US20130166243A1 (en) Test device and method for testing stability of electronic devices
CN107992410B (en) Software quality monitoring method and device, computer equipment and storage medium
US20170322120A1 (en) Fault detection using event-based predictive models
CN111309539A (en) Abnormity monitoring method and device and electronic equipment
US20180121275A1 (en) Method and apparatus for detecting and managing faults
CN111666187B (en) Method and apparatus for detecting abnormal response time
WO2022001125A1 (en) Method, system and device for predicting storage failure in storage system
WO2020082516A1 (en) Operation and maintenance data processing method, system and device
CN112286771A (en) Alarm method for monitoring global resources
CN113342589B (en) Method and device for pressure testing of server
CN115499302A (en) Monitoring method and device of business system, readable storage medium and electronic equipment
CN114138617B (en) Self-learning frequency conversion monitoring method and system, electronic equipment and storage medium
CN113992602B (en) Cable monitoring data uploading method, device, equipment and storage medium
CN113487086A (en) Method and device for predicting remaining service life of equipment, computer equipment and medium
CN116414608A (en) Abnormality detection method, abnormality detection device, abnormality detection apparatus, and storage medium
CN116755974A (en) Cloud computing platform operation and maintenance method and device, electronic equipment and storage medium
CN116306240A (en) Device health and life prediction method and device, computer device and 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