A method and device for testing system pressure performance

By copying online requested data and adjusting the feature, the problem that existing system capacity testing methods cannot effectively simulate peak traffic scenarios is solved, and efficient and flexible system pressure performance testing is achieved.

CN113760680BActive Publication Date: 2025-03-18BEIJING WODONG TIANJUN INFORMATION TECH CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202110210511.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2021-02-25
Publication Date
2025-03-18
Estimated Expiration
2041-02-25

AI Technical Summary

Technical Problem

The existing system capacity testing methods cannot effectively simulate peak traffic scenarios, the daily request data is insufficient, the order and interval time of artificial request data is fixed, resulting in long data production and verification time, and adjusting request characteristics requires modifying code, which is time-consuming.

Method used

Feature adjustments are performed to realize system stress performance testing by copying online request data into the mapping model and using the model to send the request data of the same user to the specification model in serial order in the request order.

Benefits of technology

It realizes multiple requests for the same user and interval time simulation, ensuring the effectiveness and timeliness of requests, shortening the test time, improving the test efficiency, and meeting the flexibility needs of testers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113760680B_ABST
    Figure CN113760680B_ABST
Patent Text Reader

Abstract

The present invention discloses a method and device for system stress performance testing, and relates to the field of computer technology. A specific implementation of the method includes: copying online request data into a mapping model; using the mapping model to send the request data of the same user in serial order to the same protocol model; using the protocol model to adjust the characteristics of the request data to perform system stress performance testing. This implementation can preserve the order of multiple requests from the same user, simulate the interval time of multiple requests from the same user, and ensure the validity and timeliness of the requests, and adjust the characteristics of the request data during the test execution process, which meets the tester's requirements for test flexibility, shortens the entire test time, and improves test efficiency.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and device for testing system pressure performance. Background Art

[0002] The service system capacity test can accurately and efficiently determine whether the system meets the standards and discover system problems, thereby determining the optimization direction of the system and guiding the system expansion decision. The service system capacity verification mainly includes: estimation of service request volume, system capacity estimation and expansion, and service capacity verification after expansion. To verify whether the system capacity can support peak traffic, a common method is to perform end-to-end performance testing on the service system. At present, the existing system capacity test data is mostly obtained by collecting and modifying request logs, that is, using test data generated by offline daily requests or supplementing some artificial false data to increase test data.

[0003] In the process of implementing the present invention, the inventors found that there are at least the following problems in the prior art:

[0004] There is less test data for daily requests, and it cannot meet the needs of simulating peak traffic scenarios while ensuring timeliness. The order and interval time of artificial request data are often fixed, and a longer data production and verification time is required to ensure the actual request situation of the data service. When adjusting the characteristics of the request, the code needs to be modified to regenerate the test data, which takes a lot of time. Summary of the invention

[0005] In view of this, an embodiment of the present invention provides a method and device for system stress performance testing, which can preserve the order of multiple requests from the same user, simulate the interval time of multiple requests from the same user, ensure the validity and timeliness of the requests, and adjust the characteristics of the request data during the test execution, thereby meeting the tester's requirements for test flexibility, shortening the entire test time, and improving test efficiency.

[0006] To achieve the above objective, according to one aspect of an embodiment of the present invention, a method for testing system pressure performance is provided.

[0007] A method for system stress performance testing includes: copying online request data into a mapping model; using the mapping model to serially send the request data of the same user to the same protocol model in the order of requests; and using the protocol model to perform feature adjustment on the request data to perform system stress performance testing.

[0008] Optionally, using the mapping model to send the request data of the same user serially to the same protocol model in the order of requests includes: obtaining the user identifier corresponding to each request data and the preset number of protocol models; using the mapping model to take the modulus of the number of protocol models by the user identifier of each request to integrate the request data of the same user; and sending the request data of the same user serially to the same protocol model in the order of requests.

[0009] Optionally, the feature adjustment includes: adjusting the flow size of the request data, adjusting the proportion of the components of the request data, adjusting the interval time of the request, adjusting the number of requests per second, and adjusting the number of connections.

[0010] Optionally, if the feature adjustment is to adjust the flow size of the request data, then using the protocol model to perform feature adjustment on the request data for system stress performance testing includes: presetting a virtual user identifier set; using the protocol model to obtain the user identifier corresponding to the request data, and mapping the user identifier to a virtual user identifier in the virtual user identifier set; copying the request data, and associating the copied request data with the mapped virtual user identifier to adjust the flow size of the request data for system stress performance testing.

[0011] Optionally, if the feature adjustment is to adjust the proportion of components of the request data, then using the specification model to perform feature adjustment on the request data for system stress performance testing includes: using the specification model to obtain preset component categories of the request data and the expected proportion of each component; mapping the request data to different component categories; adjusting the proportion of components of the request data by amplifying components of some categories to perform system stress performance testing.

[0012] Optionally, a post-compensation mechanism is used to adjust the ratio of the components of the request data to dynamically adjust the ratio of the components of the request data.

[0013] Optionally, if the characteristic adjustment is to adjust the interval time of the requests, then using the protocol model to perform characteristic adjustment on the request data to perform a system stress performance test includes: using the protocol model to delay the sending time of some requests to adjust the interval time of the requests to perform a system stress performance test.

[0014] Optionally, the interval between requests can be shortened by delaying requests with earlier request times and sending requests with later request times normally; the interval between requests can be increased by delaying requests with later request times and sending requests with earlier request times normally.

[0015] According to another aspect of an embodiment of the present invention, a device for testing system pressure performance is provided.

[0016] A device for system stress performance testing includes: a request replication module, used to copy online request data into a mapping model; a request mapping module, used to use the mapping model to send the request data of the same user in serial order to the same protocol model in accordance with the request sequence; and a request adjustment module, used to use the protocol model to perform feature adjustment on the request data for system stress performance testing.

[0017] Optionally, the request mapping module is also used to: obtain the user identifier corresponding to each request data and the number of preset protocol models; use the mapping model to take the user identifier of each request modulo the number of protocol models to integrate the request data of the same user; and send the request data of the same user serially to the same protocol model in order of request.

[0018] Optionally, the feature adjustment includes: adjusting the flow size of the request data, adjusting the proportion of the components of the request data, adjusting the interval time of the request, adjusting the number of requests per second, and adjusting the number of connections.

[0019] Optionally, if the feature is adjusted to adjust the flow size of the request data, the request adjustment module is also used to: preset a virtual user identifier set; use the protocol model to obtain the user identifier corresponding to the request data, and map the user identifier to the virtual user identifier in the virtual user identifier set; copy the request data, and associate the copied request data with the mapped virtual user identifier to adjust the flow size of the request data to perform system stress performance testing.

[0020] Optionally, if the feature adjustment is to adjust the proportion of components of the request data, the request adjustment module is also used to: use the specification model to obtain preset component categories of the request data and the expected proportion of each component; map the request data to different component categories; adjust the proportion of components of the request data by amplifying components of some categories to perform system stress performance testing.

[0021] Optionally, a post-compensation mechanism is used to adjust the ratio of the components of the request data to dynamically adjust the ratio of the components of the request data.

[0022] Optionally, if the feature adjustment is to adjust the interval time of requests, the request adjustment module is further used to: use the protocol model to delay the sending time of some requests to adjust the interval time of requests to perform system stress performance testing.

[0023] Optionally, the interval between requests can be shortened by delaying requests with earlier request times and sending requests with later request times normally; the interval between requests can be increased by delaying requests with later request times and sending requests with earlier request times normally.

[0024] According to yet another aspect of an embodiment of the present invention, an electronic device for system stress performance testing is provided.

[0025] An electronic device for system stress performance testing includes: one or more processors; a storage device for storing one or more programs, when the one or more programs are executed by the one or more processors, the one or more processors implement the system stress performance testing method provided by an embodiment of the present invention.

[0026] According to still another aspect of the embodiments of the present invention, a computer readable medium is provided.

[0027] A computer readable medium stores a computer program, which, when executed by a processor, implements a method for testing system pressure performance provided by an embodiment of the present invention.

[0028] One embodiment of the above invention has the following advantages or beneficial effects: by copying online request data into a mapping model; using a mapping model to send the request data of the same user serially to the same protocol model in the order of requests; using a protocol model to adjust the characteristics of the request data for system stress performance testing, the order of multiple requests of the same user can be preserved, the interval time of multiple requests of the same user can be simulated, and the validity and timeliness of the requests can be guaranteed. In addition, the characteristics of the request data are adjusted during the test execution process, which meets the tester's requirements for test flexibility and shortens the entire test time. The present invention simulates user behavior accurately, faithfully, and efficiently by combining the copying of online traffic with the dynamic adjustment of request characteristics during the test execution phase. The solution of the present invention, which combines the copying of online traffic with the dynamic adjustment of request characteristics during the test execution phase, directly skips the offline data production phase and improves test efficiency.

[0029] The further effects of the above-mentioned non-conventional optional manner will be described below in conjunction with the specific implementation manner. BRIEF DESCRIPTION OF THE DRAWINGS

[0030] The accompanying drawings are used to better understand the present invention and do not constitute an improper limitation of the present invention.

[0031] Figure 1 It is a schematic diagram of the implementation flow of the performance test of an embodiment of the present invention;

[0032] Figure 2is a schematic diagram of main steps of a method for testing system pressure performance according to an embodiment of the present invention;

[0033] Figure 3 It is a schematic diagram of the implementation principle of the system pressure performance test of an embodiment of the present invention;

[0034] Figure 4 is a schematic diagram of main modules of a device for system pressure performance testing according to an embodiment of the present invention;

[0035] Figure 5 is an exemplary system architecture diagram to which embodiments of the present invention may be applied;

[0036] Figure 6 It is a schematic diagram of the structure of a computer system of a terminal device or a server suitable for implementing an embodiment of the present invention. DETAILED DESCRIPTION

[0037] The following is a description of exemplary embodiments of the present invention in conjunction with the accompanying drawings, including various details of the embodiments of the present invention to facilitate understanding, which should be considered as merely exemplary. Therefore, it should be recognized by those of ordinary skill in the art that various changes and modifications may be made to the embodiments described herein without departing from the scope and spirit of the present invention. Similarly, for clarity and conciseness, the description of well-known functions and structures is omitted in the following description.

[0038] Every year during the e-commerce promotion period, user visits and business volume will increase dramatically, which brings severe challenges to the service systems related to the e-commerce platform. In order to serve the promotion activities well, the R&D department needs to complete the following tasks before the promotion: estimation of service request volume, system capacity estimation and expansion, and service capacity verification after expansion. Service system capacity verification is to accurately and efficiently determine whether the system meets the standards and find problems, so as to determine the optimization direction of the system and guide the system expansion decision.

[0039] To verify whether the system capacity can support the peak traffic during a big promotion, a common method is to perform end-to-end performance testing on the service system. Internet systems, especially e-commerce services, need to simulate the following features to ensure that they are consistent with the actual situation and ensure the accuracy and reliability of the test results:

[0040] (1) The validity and timeliness of the request, ensuring that the system processes the request according to complete logic;

[0041] (2) The order and interval of multiple requests from a single user, simulating real users requesting services in a certain logical order and interval. Only in this way can the service system work in the same way as in production;

[0042] (3) The proportion of requests should be as consistent as possible with that during the promotion. This is also an important factor in ensuring the accuracy of the test, because there are many types of access system requests and the time required to process them varies.

[0043] (4) The number of requests is required to reach a certain level to simulate the peak traffic of a major promotion. The number of requests is affected by factors such as the test execution time, the QPS of the performance test, and whether the requests can be repeated.

[0044] The existing production performance test request data technology cannot well simulate the request characteristics during a big promotion:

[0045] (1) Multiple requests from the same user may fall on multiple machines and be distributed in multiple file systems. This makes it difficult to guarantee the order of test requests; it is even more impossible to guarantee the interval between requests.

[0046] (2) Cluster performance testing is usually conducted 1-2 months before a big promotion. The proportion of daily user request types is very different from that during the promotion.

[0047] (3) To ensure the timeliness of requests, existing technologies need to start production within 24 hours before the test to ensure that the promotional coupons or activities have not expired; and to ensure that the requests reach the tens of millions and hundreds of millions, it takes a long time to produce, transmit, and store data. In this way, "ensuring the timeliness of data" and "data must reach a certain level" are contradictory and need to be balanced;

[0048] (4) In addition, since the peak traffic volume during a big promotion is several times, even ten or dozens of times, higher than the daily traffic volume, the requests in the logs captured within 24 hours cannot meet a certain order of magnitude. It is necessary to capture request data for 48 hours or even longer to solve the data volume problem, but this will affect the timeliness of the data.

[0049] In short, the method of using only offline production test data cannot meet the needs of simulating peak traffic scenarios while ensuring timeliness, as there is less test data for daily requests. The order and interval time of artificial request data are often fixed, requiring a long data production and verification time to ensure the actual request situation of the data service. In addition, when adjusting the characteristics of the request, it is necessary to modify the code and regenerate the test data, which takes a lot of time.

[0050] The implementation principle of the present invention is to solve the request features that need to be simulated in the performance test through the two stages of "copying online traffic" and "performance test execution". The order preservation of multiple requests from the same user, the simulation of the interval time of multiple requests from the same user, and the validity and timeliness of the request can be easily solved by "copying online traffic"; the feature adjustment of other requests, such as: the proportion of request type composition, enlarging or reducing the online user request traffic, the interval time of requests, the number of requests per second, the maximum number of connections for concurrent requests, etc., are placed in the "performance test execution" stage and solved by performance testing tools.

[0051] Figure 1 FIG. 1 is a schematic diagram of a performance test implementation process of an embodiment of the present invention. Figure 1 As shown, in the online traffic replication phase, the online request data is replicated for performance testing; then the performance test execution phase is entered, and the characteristics of the replicated online request data are adjusted for performance testing. First, it is determined whether the proportion of the components of the request data needs to be adjusted. The component categories of the request data can be obtained according to the request parameters. For example, the request data can be classified according to the terminal type client_type parameter included in the request parameters: client_type=app in the request parameters of the App (application) request, and client_type=pc in the request parameters of the PC (personal computer) request, so that the request data can be divided into App requests and PC requests. If the proportion needs to be adjusted, the proportion of the online request traffic composition is adjusted and the online request traffic is expanded; otherwise, the online request traffic is directly expanded. Usually, when performing system performance testing, the system capacity needs to be tested, and the replicated online traffic is limited, so the replicated online traffic needs to be amplified to simulate the actual promotion situation as accurately as possible. After expanding the online request traffic, it is determined whether the request interval time needs to be adjusted. If so, the request interval time is adjusted. Otherwise, it is determined whether the number of requests per second and the maximum number of connections need to be adjusted. In the embodiment of the present invention, adjusting request characteristics such as the number of requests per second (QPS) and the maximum number of connections for concurrent requests are not the focus of the present invention and will not be described in detail below.

[0052] In an embodiment of the present invention, most of the request features are adjusted during the performance test execution phase, thereby satisfying the tester's requirements for test flexibility and shortening the entire test time, including: the time for producing data and the time for re-executing the produced data (the prior art requires re-producing data after adjusting the request features).

[0053] The system stress performance testing method for dynamically adjusting request characteristics of the present invention mainly includes two stages: the online traffic replication stage and the performance test execution stage. Among them, in the online traffic replication stage, the real-time requests on the daily line are directly amplified. Compared with the test data produced offline, its advantage is that the order of user requests, the interval time of requests, the diversity of requests, the distribution of requests and other characteristics are closer to the test scenario (big promotion). In particular, the interval time of multiple requests from the same user is exactly the same as that of the real user, which is difficult to achieve with offline production test request data. In the performance test execution stage, the test request characteristics are adjusted by relying on the test tool. The test tool needs to have these functions in the framework: a high-performance HTTP or TCP programming framework; support for concurrent processing of multiple processes or multiple threads; use of an event-driven architecture for easy expansion; and providing an API or SDK for secondary programming.

[0054] During the performance test execution phase, the test tool mainly implements the following functions:

[0055] 1. Preserve the order of multiple requests from the same user. Put multiple requests from the same user into one test tool execution process. In a single-worker process and single-thread environment, the requests are processed serially. The order and interval of multiple requests from the same user are not changed.

[0056] 2. Increase the number of online users. Replace the user ID to increase the number of requests and simulate more users accessing the system.

[0057] 3. Adjust the proportion of request classification. Map requests to different categories, and according to the expected proportion of these categories, use efficient methods to amplify certain categories to meet the expected proportion;

[0058] 4. Adjust the interval time of user requests. Since multiple requests of the same user are strictly executed in a single-process and single-thread environment, the interval time can be shortened by delaying the request with an earlier request time and sending the request with a later request time normally; conversely, the interval time can be increased by delaying the request with a later request time and sending the request with an earlier request time normally. Of course, in order to ensure that the interval time conforms to the normal distribution, the increased or shortened delay time can be a random value.

[0059] Combine the following Figure 2 and Figure 3 To introduce the specific implementation process of the performance testing method of the present invention. Figure 2 is a schematic diagram of main steps of a method for testing system pressure performance according to an embodiment of the present invention; Figure 3 It is a schematic diagram of the implementation principle of the system pressure performance test according to an embodiment of the present invention.

[0060] like Figure 2As shown, the method for system pressure performance testing of the embodiment of the present invention mainly includes the following steps S201 to S203.

[0061] Step S201: copying online request data into the mapping model;

[0062] Step S202: using the mapping model to serially send the request data of the same user to the same protocol model in the order of the requests;

[0063] Step S203: Use the specification model to adjust the characteristics of the request data to perform system stress performance testing.

[0064] According to the above-mentioned steps S201 to S203, the order of multiple requests of the same user can be maintained, the interval time of multiple requests of the same user can be simulated, and the validity and timeliness of the requests can be guaranteed. In addition, the characteristics of the request data can be adjusted during the test execution, thereby meeting the tester's requirements for test flexibility and shortening the entire test time.

[0065] like Figure 3 As shown, in one embodiment of the present invention, the traffic of real user requests of the online service cluster is copied through the traffic diversion tool GO Replay or TCP COPY to the performance testing tool composed of the OpenResty (a scalable Web platform based on Nginx) cluster. The mapping (Map) model and the reduction (Reduce) model are formed through the OpenResty cluster to dynamically adjust the request characteristics to simulate the user behavior during the promotion with high fidelity; and then the request is sent to the service cluster under test.

[0066] GoReplay is an open source test tool for HTTP or TCP traffic replication, recording and playback. Through simple configuration, it can efficiently replicate real online traffic to the test environment without affecting online traffic.

[0067] OpenResty is a high-performance Web platform based on Nginx and Lua, which integrates a large number of sophisticated Lua libraries, third-party modules, and most dependencies. It is used to easily build dynamic Web applications, Web services, and dynamic gateways that can handle ultra-high concurrency and high scalability. Nginx's programming model can process requests sequentially in a single-process, single-threaded operating environment.

[0068] In the specific implementation, in order to ensure that the requests of the same user are sent to the same OpenResty to maintain order and support the simultaneous execution of multiple stress testing tasks, several OpenResty instances are divided into two groups, which implement the mapping model and the reduction model respectively to complete the functions of diversion and dynamic adjustment of request characteristics.

[0069] According to an embodiment of the present invention, when the mapping model is used to serially send the request data of the same user to the same specification model in the order of the requests, the following may be specifically included:

[0070] Obtain the user ID and the number of preset protocol models corresponding to each request data;

[0071] Use the mapping model to modulo the user ID of each request with the number of specification models to integrate the request data of the same user;

[0072] According to the request order, the request data of the same user are sent serially to the same protocol model.

[0073] MapReduce is a computing model, framework and platform for parallel processing of big data. It implies the following three meanings: a high-performance parallel computing platform based on clusters; a parallel computing and operation software framework; and a parallel programming model and method. The first group of OpenResty instances implements the mapping function (Map) function to read and process requests. A mapping function (Map) performs a specified operation on each request in the request queue. In implementation, the user ID of each request is modulo the number of instances of the second group of OpenResty, so that requests from the same user are sent to the same second group of OpenResty instances. The second group of OpenResty instances implements the reduction function (Reduce) function. The reduction or simplified operation (Reduce) is to adjust the characteristics of the request set processed by the mapping function (Map).

[0074] In an embodiment of the present invention, feature adjustment may mainly include: adjusting the flow size of request data, adjusting the proportion of components of request data, adjusting the interval time of requests, adjusting the number of requests per second, adjusting the number of connections, etc.

[0075] According to an embodiment of the present invention, if the feature adjustment is to adjust the flow size of the request data, then using the specification model to perform feature adjustment on the request data to perform a system stress performance test includes:

[0076] Preset a virtual user ID set;

[0077] Using the specification model to obtain a user identifier corresponding to the request data, and mapping the user identifier to a virtual user identifier in the virtual user identifier set;

[0078] The request data is copied, and the copied request data is associated with the mapped virtual user identifier to adjust the flow size of the request data to perform a system stress performance test.

[0079] After the specification model receives the request data sent by the mapping model, it adjusts the characteristics of the request data for performance testing. Through the mapping model implemented by the first group of OpenResty clusters, the request data of the same user is distributed to the same specification model as the input of the data queue. In the performance test scenario, when the traffic size of the request data needs to be adjusted, it is generally necessary to amplify the traffic of the online request data. The specific implementation method is: prepare a virtual user identification ID set, which is basically consistent with the actual number of users in the promotion scenario in terms of magnitude. For example, the user ID generated by the system corresponding to each user name after the user registers the user name on the website can be used as the virtual user ID prepared here, and the virtual user ID with the same order of magnitude as the user in the promotion scenario is selected to form a virtual user ID set. Then, number each virtual user ID. Assuming that the size of the virtual user ID set is size, map from 0 to (size-1) to each virtual user ID respectively. For example: 0 corresponds to virtual user A, 1 corresponds to virtual user B, 2 corresponds to virtual user C, ..., (size-1) corresponds to virtual user size.

[0080] When it is necessary to amplify a certain request data, first obtain the user ID of the request data and convert the user ID of the request data into a digital type; then take the digital user ID modulo the size of the virtual user ID set and map it to a different fixed virtual user ID. The purpose of this is to ensure that multiple requests from the same user are replaced by another or multiple user IDs to generate new requests (one copy of the original request is retained). For example, user ID = A has three requests in sequence. When it is amplified three times, three requests corresponding to virtual user ID = B, virtual user ID = C or virtual user ID = D will be copied, for a total of nine new requests. In this way, the expansion of online request data traffic is achieved.

[0081] During the performance test, if the request data flow needs to be reduced, the request data of some user IDs can be shielded to reduce the request data flow. In this way, the size of the request data flow can be adjusted while ensuring the request sequence and time interval.

[0082] In another embodiment of the present invention, if the feature adjustment is to adjust the ratio of components of the request data, then using the specification model to perform feature adjustment on the request data to perform system stress performance testing includes:

[0083] Using the specification model, obtaining the component categories of the preset request data and the expected proportion of each component;

[0084] Mapping the request data to different component categories;

[0085] The proportion of the components of the request data is adjusted by enlarging the components of some categories to perform system stress performance testing.

[0086] In the embodiment of the present invention, since the specification model of Nginx and the like is a single process and a single thread to sequentially process the requests of a queue, and the next request will be processed only when one request is completed, a post-compensation mechanism can be used to adjust the composition ratio of the request data, and at the same time, it will not affect the efficiency of queue processing. The specific implementation steps are: first, obtain the preset component category of the request data and the expected ratio of each component, for example: take the device category corresponding to the request data as the component category of the request data, then according to the App request parameter client_type=app, the PC request parameter client_type=pc, the component statistics of the request data can be performed, assuming that the expected ratio of App requests is 70%, and the expected ratio of PC requests is 30%. Then, use a counter to count the ratio of the components of a batch of requests (for example, 1000) and determine whether it is consistent with the expected ratio. For example: assuming that the ratio of the components of the batch of requests counted by the counter is 60% (600) for App requests and 40% (400) for PC requests, it is obviously different from the expected ratio. Afterwards, the proportion of the components of the request data is adjusted by enlarging the components of some categories so that the proportion of the components of the request is consistent with the expected proportion. In this embodiment, the proportion of the App request is enlarged so that the proportion of the components of the request is consistent with the expected proportion. In order not to affect the efficiency of the test execution, the proportion of the components of the request data is adjusted using a post-compensation mechanism to dynamically adjust the proportion of the components of the request data. That is, the proportion of the components of the request data is adjusted according to the processing results of the current batch of request data so that the next batch of requests is enlarged in proportion, thereby realizing the dynamic adjustment of the proportion of the components of the request data to more accurately simulate the online request situation.

[0087] In another embodiment of the present invention, if the feature adjustment is to adjust the interval time of the request, then using the protocol model to perform feature adjustment on the request data to perform system stress performance testing includes: using the protocol model to delay the sending time of some requests to adjust the interval time of the requests to perform system stress performance testing. Specifically, the interval time of the requests can be shortened by delaying the requests with an earlier request time and sending the requests with a later request time normally; the interval time of the requests can be increased by delaying the sending of the requests with a later request time and sending the requests with an earlier request time normally.

[0088] According to the technical solution of the present invention, because the online traffic is directly copied, the order and interval of user requests are very consistent with the actual situation. Generally, there is no need to readjust the interval time of user requests. However, in different scenarios, the implementation effects of some services are also different. For example, in a big promotion scenario, users need to buy within a limited time, and the time for users to browse products is shorter than usual, which leads to a corresponding shortening of the interval between user requests.

[0089] In the reduction model implemented by the second group of OpenResty clusters of the present invention, the function of adjusting the request interval time is also implemented. Since multiple requests of the same user are strictly executed serially in a single-process, single-threaded environment, OpenResty shortens the interval time between requests by delaying the request with the earlier request time among multiple requests, and sending the request with the later request time normally (sent in the normal order in the queue); conversely, delaying the request with the later request time, and sending the request with the earlier request time normally, to increase the interval time. Of course, in order to ensure that the interval time conforms to the normal distribution, the delay time can be set to a random value.

[0090] The above is the implementation process of the performance test of the present invention. Compared with the prior art, the prior art generates performance test data by collecting and modifying request logs to simulate real user behavior; while the present invention simulates user behavior accurately, faithfully and efficiently by combining copying online traffic with dynamically adjusting request features during the test execution phase. The present invention's solution of "copying online traffic" + "dynamically adjusting request features during the test execution phase" directly skips the "offline data production" phase, improving test efficiency, which is also a clear difference from the prior art solution.

[0091] According to another aspect of the present invention, a device for testing system pressure performance is provided. Figure 4 Schematic diagram of the main modules of the device for system pressure performance testing according to an embodiment of the present invention. Figure 4 As shown, the system stress performance test device 400 according to the embodiment of the present invention mainly includes a request replication module 401 , a request mapping module 402 and a request adjustment module 403 .

[0092] The request copy module 401 is used to copy the online request data into the mapping model;

[0093] The request mapping module 402 is used to use the mapping model to serially send the request data of the same user to the same protocol model in the order of the requests;

[0094] The request adjustment module 403 is used to use the specification model to perform feature adjustment on the request data to perform system stress performance testing.

[0095] According to one embodiment of the present invention, the request mapping module 402 may also be used to:

[0096] Obtain the user ID and the number of preset protocol models corresponding to each request data;

[0097] Using the mapping model, the user identifier of each request is modulo the number of the specification models to integrate the request data of the same user;

[0098] According to the request order, the request data of the same user are sent serially to the same protocol model.

[0099] According to another embodiment of the present invention, the feature adjustment includes:

[0100] Adjust the flow size of the request data, adjust the proportion of the components of the request data, adjust the request interval, adjust the number of requests per second, and adjust the number of connections.

[0101] According to another embodiment of the present invention, if the feature adjustment is to adjust the flow size of the request data, the request adjustment module 403 may also be used to:

[0102] Preset a virtual user ID set;

[0103] Using the specification model to obtain a user identifier corresponding to the request data, and mapping the user identifier to a virtual user identifier in the virtual user identifier set;

[0104] The request data is copied, and the copied request data is associated with the mapped virtual user identifier to adjust the flow size of the request data to perform a system stress performance test.

[0105] According to yet another embodiment of the present invention, if the feature adjustment is to adjust the ratio of components of the request data, the request adjustment module 403 may also be used to:

[0106] Using the specification model, obtaining the component categories of the preset request data and the expected proportion of each component;

[0107] Mapping the request data to different component categories;

[0108] The proportion of the components of the request data is adjusted by enlarging the components of some categories to perform system stress performance testing.

[0109] In yet another embodiment of the present invention, a post-compensation mechanism is used to adjust the ratio of the components of the request data so as to dynamically adjust the ratio of the components of the request data.

[0110] According to yet another embodiment of the present invention, if the characteristic adjustment is to adjust the interval time of the request, the request adjustment module 403 may also be used to:

[0111] The protocol model is used to delay the sending time of some requests to adjust the interval time of requests so as to perform system stress performance testing.

[0112] In another embodiment of the present invention, the interval between requests is shortened by delaying requests with earlier request times and sending requests with later request times normally; the interval between requests is increased by delaying requests with later request times and sending requests with earlier request times normally.

[0113] According to the technical solution of the embodiment of the present invention, by copying the online request data into the mapping model; using the mapping model to send the request data of the same user serially to the same protocol model in the order of the requests; using the protocol model to adjust the characteristics of the request data to perform system stress performance testing, the order of multiple requests of the same user can be preserved, the interval time of multiple requests of the same user can be simulated, and the validity and timeliness of the requests can be guaranteed. In addition, the characteristics of the request data are adjusted during the test execution process, which meets the tester's requirements for test flexibility and shortens the entire test time. The present invention simulates user behavior accurately, faithfully and efficiently by combining the copying of online traffic with the dynamic adjustment of request characteristics during the test execution phase. The solution of the present invention combining "copying online traffic" with "dynamically adjusting request characteristics during the test execution phase" directly skips the "offline data production" phase and improves test efficiency.

[0114] Figure 5 An exemplary system architecture 500 is shown to which the method for system stress performance testing or the apparatus for system stress performance testing according to the embodiments of the present invention may be applied.

[0115] like Figure 5 As shown, system architecture 500 may include terminal devices 501, 502, 503, a network 504 and a server 505. Network 504 is used to provide a medium for communication links between terminal devices 501, 502, 503 and server 505. Network 504 may include various connection types, such as wired, wireless communication links or optical fiber cables, etc.

[0116] The user can use the terminal devices 501, 502, 503 to interact with the server 505 through the network 504 to receive or send messages, etc. Various communication client applications can be installed on the terminal devices 501, 502, 503, such as performance testing applications, shopping applications, web browser applications, search applications, instant messaging tools, email clients, social platform software, etc. (only as examples).

[0117] The terminal devices 501 , 502 , and 503 may be various electronic devices having a display screen and supporting web browsing, including but not limited to smart phones, tablet computers, laptop computers, desktop computers, and the like.

[0118] The server 505 may be a server that provides various services, such as a background management server (only an example) that supports shopping websites browsed by users using terminal devices 501, 502, and 503. The background management server may copy the online request data received, such as the performance test request, into a mapping model; use the mapping model to send the request data of the same user to the same protocol model in serial order according to the request sequence; use the protocol model to adjust the characteristics of the request data for performance testing and other processing, and feed back the processing results (such as performance test results, system improvement information, etc. - only an example) to the terminal device.

[0119] It should be noted that the method for system stress performance testing provided in the embodiment of the present invention is generally executed by the server 505 , and accordingly, the device for system stress performance testing is generally set in the server 505 .

[0120] It should be understood that Figure 5 The number of terminal devices, networks and servers in the embodiment is only for illustration. Any number of terminal devices, networks and servers may be provided according to implementation requirements.

[0121] Reference below Figure 6 , which shows a schematic diagram of the structure of a computer system 600 of a terminal device or a server suitable for implementing an embodiment of the present invention. Figure 6 The terminal device or server shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present invention.

[0122] like Figure 6 As shown, the computer system 600 includes a central processing unit (CPU) 601, which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) 602 or a program loaded from a storage part 608 into a random access memory (RAM) 603. In the RAM 603, various programs and data required for the operation of the system 600 are also stored. The CPU 601, the ROM 602, and the RAM 603 are connected to each other via a bus 604. An input / output (I / O) interface 605 is also connected to the bus 604.

[0123] The following components are connected to the I / O interface 605: an input section 606 including a keyboard, a mouse, etc.; an output section 607 including a cathode ray tube (CRT), a liquid crystal display (LCD), etc., and a speaker, etc.; a storage section 608 including a hard disk, etc.; and a communication section 609 including a network interface card such as a LAN card, a modem, etc. The communication section 609 performs communication processing via a network such as the Internet. A drive 610 is also connected to the I / O interface 605 as needed. A removable medium 611, such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, etc., is installed on the drive 610 as needed, so that a computer program read therefrom is installed into the storage section 608 as needed.

[0124] In particular, according to the embodiments disclosed in the present invention, the process described above with reference to the flowchart can be implemented as a computer software program. For example, the embodiments disclosed in the present invention include a computer program product, which includes a computer program carried on a computer-readable medium, and the computer program includes a program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from the network through the communication part 609, and / or installed from the removable medium 611. When the computer program is executed by the central processing unit (CPU) 601, the above-mentioned functions defined in the system of the present invention are executed.

[0125] It should be noted that the computer-readable medium shown in the present invention may be a computer-readable signal medium or a computer-readable storage medium or any combination of the above two. The computer-readable storage medium may be, for example, but not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, device or device, or any combination of the above. More specific examples of computer-readable storage media may include, but are not limited to: an electrical connection with one or more wires, a portable computer 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 disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the above. In the present invention, a computer-readable storage medium may be any tangible medium containing or storing a program that can be used by or in combination with an instruction execution system, device or device. In the present invention, a computer-readable signal medium may include a data signal propagated in a baseband or as part of a carrier wave, which carries a computer-readable program code. This propagated data signal may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, which may send, propagate or transmit a program for use by or in conjunction with an instruction execution system, apparatus or device. The program code contained on the computer-readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, optical cable, RF, etc., or any suitable combination of the above.

[0126] The flow chart and block diagram in the accompanying drawings illustrate the possible architecture, function and operation of the system, method and computer program product according to various embodiments of the present invention. In this regard, each box in the flow chart or block diagram can represent a module, a program segment, or a part of a code, and the above-mentioned module, program segment, or a part of a code contains one or more executable instructions for realizing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two boxes represented in succession can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram or flow chart, and the combination of the boxes in the block diagram or flow chart can be implemented with a dedicated hardware-based system that performs a specified function or operation, or can be implemented with a combination of dedicated hardware and computer instructions.

[0127] The units or modules involved in the embodiments of the present invention may be implemented in software or hardware. The units or modules described may also be set in a processor. For example, they may be described as: a processor includes a request replication module, a request mapping module, and a request adjustment module. The names of these units or modules do not, in some cases, constitute limitations on the units or modules themselves. For example, the request replication module may also be described as a "module for replicating online request data into a mapping model."

[0128] As another aspect, the present invention also provides a computer-readable medium, which may be included in the device described in the above embodiment; or may exist independently without being assembled into the device. The above computer-readable medium carries one or more programs, and when the above one or more programs are executed by a device, the device includes: copying online request data into a mapping model; using the mapping model to send the request data of the same user in serial order to the same protocol model; using the protocol model to adjust the characteristics of the request data to perform system stress performance testing.

[0129] According to the technical solution of the embodiment of the present invention, by copying the online request data into the mapping model; using the mapping model to send the request data of the same user serially to the same protocol model in the order of the requests; using the protocol model to adjust the characteristics of the request data to perform system stress performance testing, the order of multiple requests of the same user can be preserved, the interval time of multiple requests of the same user can be simulated, and the validity and timeliness of the requests can be guaranteed. In addition, the characteristics of the request data are adjusted during the test execution process, which meets the tester's requirements for test flexibility and shortens the entire test time. The present invention simulates user behavior accurately, faithfully and efficiently by combining the copying of online traffic with the dynamic adjustment of request characteristics during the test execution phase. The solution of the present invention combining "copying online traffic" with "dynamically adjusting request characteristics during the test execution phase" directly skips the "offline data production" phase and improves test efficiency.

[0130] The above specific implementations do not constitute a limitation on the protection scope of the present invention. It should be understood by those skilled in the art that various modifications, combinations, sub-combinations and substitutions may occur depending on design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention shall be included in the protection scope of the present invention.

Claims

1. A method for system pressure performance testing, characterized in that: include: Copy online request data into the mapping model; Using the mapping model, the request data of the same user is sent serially to the same protocol model in the order of request; Using the specification model to perform feature adjustment on the request data to perform system stress performance testing; Using the mapping model to serially send the request data of the same user to the same specification model in the order of request includes: Obtain the user ID and the number of preset protocol models corresponding to each request data; Using the mapping model, the user identifier of each request is modulo the number of the specification models to integrate the request data of the same user; According to the request order, the request data of the same user are sent serially to the same protocol model.

2. The method according to claim 1, characterized in that The feature adjustment includes: Adjust the flow size of the request data, adjust the proportion of the components of the request data, adjust the request interval, adjust the number of requests per second, and adjust the number of connections.

3. The method according to claim 1 or 2, characterized in that: If the characteristic adjustment is to adjust the flow size of the request data, then using the specification model to perform characteristic adjustment on the request data to perform the system stress performance test includes: Preset a virtual user ID set; Using the specification model to obtain a user identifier corresponding to the request data, and mapping the user identifier to a virtual user identifier in the virtual user identifier set; The request data is copied, and the copied request data is associated with the mapped virtual user identifier to adjust the flow size of the request data to perform a system stress performance test.

4. The method according to claim 1 or 2, characterized in that: If the feature adjustment is to adjust the ratio of components of the request data, then using the specification model to perform feature adjustment on the request data to perform system stress performance testing includes: Using the specification model, obtaining the component categories of the preset request data and the expected proportion of each component; Mapping the request data to different component categories; The proportion of the components of the request data is adjusted by enlarging the components of some categories to perform system stress performance testing.

5. The method according to claim 4, characterized in that A post-compensation mechanism is used to adjust the ratio of the components of the request data to dynamically adjust the ratio of the components of the request data.

6. The method according to claim 1 or 2, characterized in that: If the characteristic adjustment is to adjust the interval time of the request, then using the specification model to perform characteristic adjustment on the request data to perform the system stress performance test includes: The protocol model is used to delay the sending time of some requests to adjust the interval time of requests so as to perform system stress performance testing.

7. The method according to claim 6, characterized in that By delaying the request with an earlier request time and sending the request with a later request time normally, the interval between requests can be shortened; by delaying the request with a later request time and sending the request with an earlier request time normally, the interval between requests can be increased.

8. A device for testing system pressure performance, characterized in that: include: Request replication module, used to replicate online request data into the mapping model; A request mapping module, used to use the mapping model to send the request data of the same user to the same protocol model in serial order according to the request sequence; A request adjustment module, used to use the specification model to perform feature adjustment on the request data to perform system stress performance testing; The request mapping module is further used to: obtain the user identifier corresponding to each request data and the number of preset protocol models; Using the mapping model, the user identifier of each request is modulo the number of the specification models to integrate the request data of the same user; According to the request order, the request data of the same user are sent serially to the same protocol model.

9. An electronic device for system pressure performance testing, characterized in that: include: one or more processors; a storage device for storing one or more programs, When the one or more programs are executed by the one or more processors, the one or more processors implement the method according to any one of claims 1 to 7.

10. A computer readable medium having a computer program stored thereon, characterized in that: When the program is executed by a processor, the method according to any one of claims 1 to 7 is implemented.

Citation Information

Patent Citations

  • Network software online testing method and system

    CN103580943A

  • Software performance testing method and device

    CN110175118A