A configuration method, device, equipment, medium and program product of a pressure measurement environment

By replicating the registration and subscription status of the production environment in the stress testing environment, the problem of insufficient test scale in existing technologies is solved, enabling efficient system performance evaluation and potential bottleneck discovery, and ensuring the reliability and stability of microservice applications.

CN119520336BActive Publication Date: 2026-04-28INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 2 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
INDUSTRIAL AND COMMERCIAL BANK OF CHINA
Filing Date
2024-11-26
Publication Date
2026-04-28

AI Technical Summary

Technical Problem

In enterprise microservice architectures, existing load testing environments cannot accurately replicate the registration and subscription data of the production environment, resulting in test scales that are far lower than the production service volume. This fails to truly reflect the production situation and affects the reliability and stability of microservice applications.

Method used

By obtaining the registration and subscription information and scaling ratio of the production environment, the server mapping relationship between the production environment and the load testing environment is determined. A registration center cluster of the same size is deployed, the address correspondence between the service provider and the consumer is established, and the connection to the registration center is configured for registration and subscription to simulate microservice calls in the production environment.

Benefits of technology

It enables stress testing in the test environment at production scale or multiples of production scale, which can accurately evaluate system performance, discover potential performance bottlenecks, ensure the consistency of service interaction relationships, and improve the practical application value of testing.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520336B_ABST
    Figure CN119520336B_ABST
Patent Text Reader

Abstract

The application discloses a configuration method, device and equipment of a pressure test environment, a medium and a program product. The method comprises the following steps: determining a server mapping relationship between a production environment and a pressure test environment; deploying a registration center cluster of the same scale in the pressure test environment according to the scale of the registration center cluster in the production environment; determining the addresses of each service provider and each service consumer in the pressure test environment according to registration subscription information, and establishing the corresponding relationship between each service provider and each service consumer in the pressure test environment; configuring each service provider and each service consumer in the pressure test environment to connect the registration center in the pressure test environment, and starting each service provider and each service consumer in the pressure test environment to perform registration subscription. The technical solution can be applied to the field of distributed technology, can reproduce the actual registration subscription of the microservice in the production environment in the test environment, and can test the test environment according to the production scale or a multiple of the production scale.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of distributed technology, and in particular to a method, apparatus, equipment, medium, and program product for configuring a stress testing environment. Background Technology

[0002] With the large-scale deployment of enterprise microservice architectures, a large number of servers are needed to build distributed systems. In order to achieve efficient, stable and reliable service levels in practical applications, enterprises often deploy a large number of servers in the production stage to ensure that each microservice can run smoothly and meet business needs such as high concurrency and large data volume processing. However, in the testing environment, due to factors such as limited resources, cost control and relatively simplified testing scenarios, the number of servers is usually smaller. The difference in the number of servers in the production and testing environments brings a series of problems and challenges to the enterprise's software development and testing work.

[0003] For existing stress testing environments, microservice registry centers cannot accurately replicate the registration and subscription data in actual production environments for effective stress testing. Furthermore, due to the lack of a stress testing environment equivalent to the production environment, the test scale is far lower than the production service volume, which may result in an inability to truly reflect the actual situation in production. This leaves them helpless when dealing with performance issues in production service calls, seriously affecting the reliability and stability of microservice applications. Summary of the Invention

[0004] This invention provides a method, apparatus, equipment, medium, and program product for configuring a stress testing environment, which can be applied to the field of distributed technology. It can replicate the actual registration and subscription of microservices in the production environment in the test environment, so that the test environment can perform stress testing at the production scale or a multiple of the production scale.

[0005] According to one aspect of the present invention, a method for configuring a stress testing environment is provided, comprising:

[0006] Obtain the registration and subscription information and load testing scaling ratio of the production environment, and determine the server mapping relationship between the production environment and the load testing environment based on the scaling ratio;

[0007] Based on the size of the registry cluster in the production environment, deploy a registry cluster of the same size in the stress testing environment;

[0008] Based on the registration and subscription information, determine the addresses of each service provider and each service consumer in the stress testing environment, and establish the correspondence between each service provider and each service consumer in the stress testing environment;

[0009] Configure each service provider and service consumer in the load testing environment to connect to the registry center in the load testing environment, and start each service provider and service consumer in the load testing environment to register and subscribe, so as to complete the configuration of the load testing environment.

[0010] Optionally, the load testing scaling ratio is obtained, and the server mapping relationship between the production environment and the load testing environment is determined based on the scaling ratio, including:

[0011] Determine the load testing scaling ratio based on the number of production servers in the production environment and the number of test servers in the load testing environment;

[0012] Based on the scaling ratio, establish a mapping relationship between multiple first servers in the production environment and second servers in the load testing environment;

[0013] Multiple nodes are created in the second server, and a one-to-one mapping relationship is established between the nodes and the first server.

[0014] The advantages of this setup are: it allows for the rational allocation of load testing resources based on the comparison between the actual number of test servers and the number of production servers, enabling enterprises to obtain accurate assessments of system performance at a lower cost during the testing phase, thereby maximizing cost-effectiveness; and it establishes a mapping relationship between servers based on the scaling ratio, allowing the load testing environment to scientifically simulate the load conditions of the production environment.

[0015] Optionally, based on the registration and subscription information, the addresses of each service provider and each service consumer in the stress testing environment are determined, and the correspondence between each service provider and each service consumer in the stress testing environment is established, including:

[0016] The registration and subscription information is replayed in the stress testing environment to form the data foundation of the stress testing environment, and the first server addresses of each service provider and each service consumer in the production environment are determined based on the registration and subscription information.

[0017] Based on the mapping relationship between each node in the stress testing environment and each production server in the production environment, as well as the address of the first server, determine the node addresses of each service provider and each service consumer in the stress testing environment.

[0018] Based on the correspondence between service providers and service consumers in the production environment, establish a one-to-one correspondence between service providers and service consumers in the stress testing environment.

[0019] The advantages of this setup are: by replaying registration and subscription information in the stress testing environment to form a data foundation, the data distribution and business logic relationships in the stress testing environment can be kept highly consistent with the production environment. Based on the mapping relationship between the stress testing environment and the production environment, as well as the address of the first server, the node addresses of each service provider and service consumer in the stress testing environment can be determined, enabling accurate address translation. This ensures that in the stress testing environment, service providers and service consumers can communicate according to logic similar to that in the production environment, establishing a one-to-one correspondence between each service provider and service consumer in the stress testing environment, and completely reproducing the service interaction relationships in the production environment.

[0020] Optionally, the load testing scaling ratio is obtained, and the server mapping relationship between the production environment and the load testing environment is determined based on the scaling ratio, including:

[0021] When performing full capacity expansion load testing, the load testing scaling ratio is determined based on the number of production servers after expansion in the production environment and the number of test servers in the load testing environment.

[0022] Based on the scaling ratio, establish a mapping relationship between the first server in the production environment and multiple second servers in the load testing environment.

[0023] The advantages of this setup are: it can better simulate the production environment under expansion scenarios, accurately analyze the expansion situation of the production environment, and more realistically test the system's performance after full expansion, such as key indicators like system throughput and response time. This makes the stress test results more valuable for practical application and helps enterprises identify potential performance bottlenecks in advance.

[0024] Optionally, based on the registration and subscription information, the addresses of each service provider and each service consumer in the stress testing environment are determined, and the correspondence between each service provider and each service consumer in the stress testing environment is established, including:

[0025] The registration and subscription information is replayed in the stress testing environment to form the data foundation of the stress testing environment, and the first server addresses of each service provider and each service consumer in the production environment are determined based on the registration and subscription information.

[0026] When performing a full-scale load test, the second server addresses of each service provider and each service consumer in the load test environment are determined based on the mapping relationship between each test server in the load test environment and each production server in the production environment, as well as the first server address.

[0027] Based on the correspondence between service providers and service consumers in the production environment, establish a one-to-one correspondence between service providers and service consumers in the stress testing environment.

[0028] The advantages of this setup are: by replaying registration and subscription information in the stress testing environment to form a data foundation, the data distribution and business logic relationships in the stress testing environment can be kept highly consistent with those in the production environment. It can achieve accurate address translation in full-scale expansion scenarios, ensuring that service providers and service consumers can communicate in the stress testing environment according to logic similar to that in the production environment. It establishes a one-to-one correspondence between each service provider and each service consumer in the stress testing environment, and can completely reproduce the service interaction relationships in the production environment.

[0029] Optionally, determine the server mapping relationship between the production environment and the load testing environment, including:

[0030] When performing link expansion stress testing, at least one target service to be expanded in the production environment and the target link to which the target service belongs are determined according to the link expansion parameters, and the call topology of the target link is determined according to the registration and subscription information.

[0031] Based on the call topology of the target link, identify each production server belonging to the target link in the production environment, and determine the expansion scale of the target service based on the link expansion parameters.

[0032] Based on the production servers in the target link and the expansion scale of the target service, determine the target servers in the expanded target link and establish the mapping relationship between each target server and each second server in the stress test environment.

[0033] The advantages of this setup are: it can comprehensively verify the system stability of the target link after expansion, help verify the system's scalability, conduct targeted stress tests, and identify the performance bottlenecks of the target service after expansion in advance.

[0034] According to another aspect of the present invention, a configuration apparatus for a pressure testing environment is provided, comprising:

[0035] The server mapping module is used to obtain the registration and subscription information and load testing scaling ratio of the production environment, and determine the server mapping relationship between the production environment and the load testing environment based on the scaling ratio.

[0036] The registry cluster deployment module is used to deploy a registry cluster of the same size in the stress testing environment, based on the size of the registry cluster in the production environment.

[0037] The service correspondence establishment module is used to determine the addresses of each service provider and each service consumer in the stress testing environment based on the registration and subscription information, and to establish the correspondence between each service provider and each service consumer in the stress testing environment.

[0038] The connection startup module is used to configure each service provider and each service consumer in the load testing environment to connect to the registry center in the load testing environment, and to start each service provider and each service consumer in the load testing environment to register and subscribe, so as to complete the configuration of the load testing environment.

[0039] According to another aspect of the present invention, an electronic device is provided, the electronic device comprising:

[0040] At least one processor; and

[0041] A memory communicatively connected to the at least one processor; wherein,

[0042] The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to execute the configuration method of the stress testing environment according to any embodiment of the present invention.

[0043] According to another aspect of the present invention, a computer-readable storage medium is provided, the computer-readable storage medium storing computer instructions for causing a processor to execute and implement the configuration method of the stress testing environment according to any embodiment of the present invention.

[0044] According to another aspect of the present invention, a computer program product is provided, the computer program product comprising a computer program that, when executed by a processor, implements the configuration method of the stress testing environment according to any embodiment of the present invention.

[0045] The technical solution of this invention, by determining the server mapping relationship between the production environment and the stress testing environment, deploys a registration center cluster of the same scale as the production environment in the stress testing environment, determines the addresses of each service provider and each service consumer in the stress testing environment based on the registration and subscription information, establishes the correspondence between each service provider and each service consumer in the stress testing environment, configures each service provider and each service consumer in the stress testing environment to connect to the registration center in the stress testing environment, and starts each service provider and each service consumer in the stress testing environment to perform registration and subscription, can simulate microservice calls of the full data of the production environment. Based on a small number of servers in the existing stress testing environment, it replicates the actual registration and subscription situation of microservices in the production environment, so that the test environment can perform stress testing at the production scale or a multiple of the production scale.

[0046] It should be understood that the description in this section is not intended to identify key or essential features of the embodiments of the present invention, nor is it intended to limit the scope of the invention. Other features of the invention will become readily apparent from the following description. Attached Figure Description

[0047] To more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings used in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0048] Figure 1 This is a flowchart of a method for configuring a stress testing environment according to Embodiment 1 of the present invention;

[0049] Figure 2 This is a flowchart of another method for configuring a stress testing environment according to Embodiment 2 of the present invention;

[0050] Figure 3 This is a flowchart of another method for configuring a stress testing environment according to Embodiment 3 of the present invention;

[0051] Figure 4 This is a flowchart of another method for configuring a stress testing environment according to Embodiment 4 of the present invention;

[0052] Figure 5 This is a schematic diagram of the configuration device for a pressure testing environment according to Embodiment 5 of the present invention;

[0053] Figure 6 This is a schematic diagram of the structure of an electronic device that implements the configuration method of the stress testing environment according to an embodiment of the present invention. Detailed Implementation

[0054] To enable those skilled in the art to better understand the present invention, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings of the embodiments of the present invention. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort should fall within the scope of protection of the present invention.

[0055] It should be noted that the terms "first," "second," etc., in the specification, claims, and accompanying drawings of this invention are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. It should be understood that such data can be interchanged where appropriate so that the embodiments of the invention described herein can be implemented in orders other than those illustrated or described herein. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover a non-exclusive inclusion; for example, a process, method, system, product, or apparatus that comprises a series of steps or units is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to such processes, methods, products, or apparatus.

[0056] Example 1

[0057] Figure 1 This is a flowchart illustrating a method for configuring a load testing environment according to Embodiment 1 of the present invention. This embodiment is applicable to configuring a load testing environment to perform load testing on large-scale servers in a production environment or to perform load testing on production expansion scenarios. This method can be executed by a load testing environment configuration device, which can be implemented in hardware and / or software, and is generally configured in a computer or processor with data processing capabilities. Figure 1 As shown, the method includes:

[0058] S110. Obtain the registration and subscription information of the production environment and the load testing scaling ratio, and determine the server mapping relationship between the production environment and the load testing environment based on the scaling ratio.

[0059] Optionally, the production environment can refer to the system environment actually used for normal business operations and providing services to users; the stress testing environment is the system environment used to stress test the production environment. Stress testing is a type of performance testing, mainly used to evaluate the system's performance under different load conditions, such as system throughput, response time, resource utilization, and other indicators.

[0060] Optionally, registration and subscription information can refer to detailed data related to service registration and subscription by other services in a microservice architecture, including service name, address, interface, and other information.

[0061] Optionally, obtaining the registration and subscription information of the production environment may include: taking a memory snapshot of the production environment registry center, generating registration and subscription information, and copying the registration and subscription information offline to the load testing environment; wherein the registration and subscription information is saved in the form of a file.

[0062] Optionally, load testing can refer to stress testing in a load testing environment, which simulates a large number of concurrent requests to evaluate the system's performance and stability under high load.

[0063] Optionally, the load testing scaling ratio can be used to represent the relative proportion of server configurations between the production environment and the load testing environment. For example, a load testing scaling ratio of 2 means that 2 servers in the production environment are mapped to 1 server in the load testing environment, simulating 2 real addresses using 2 ports; another example is a scaling ratio of 0.5, which can simulate a full capacity expansion scenario in production, mapping 1 server in the production environment to 2 servers in the load testing environment. This is only an example for illustration.

[0064] Optionally, when there are far fewer test servers in the test environment than production servers in the production environment, multiple production servers in the production environment can be mapped to the same test server, and the production servers mapped to a single test server can be distinguished by configuring different port numbers or virtual IP addresses.

[0065] S120. Based on the size of the registry cluster in the production environment, deploy a registry cluster of the same size in the stress testing environment.

[0066] Optionally, the registry center can be used to store information related to microservices, such as service names, addresses, and ports. Other microservices can discover and invoke target microservices through the registry center. A registry center cluster is a collection of multiple registry center nodes. Clustering improves the availability and reliability of the registry center, preventing single points of failure. The size of the registry center cluster is determined by the number of registry center nodes. For example, a single production server can be configured as one registry center node. In a specific production environment, three production servers can be configured with three registry center nodes, forming a registry center cluster.

[0067] Optionally, in the stress testing environment, to simulate the operating state and network topology of the production environment as realistically as possible, it is necessary to deploy a registry center cluster of the same size as the production environment. That is, a registry center cluster of the same size as the production environment should be built in the stress testing environment. This ensures that the registration and discovery mechanism of microservices in the stress testing environment remains consistent with that in the production environment during stress testing.

[0068] In a specific example, if three production servers can be configured with three registry nodes in a production environment, then three load testing servers can also be configured with three registry nodes to form a registry cluster in the load testing environment.

[0069] S130. Based on the registration and subscription information, determine the addresses of each service provider and each service consumer in the load testing environment, and establish the correspondence between each service provider and each service consumer in the load testing environment.

[0070] Optionally, a service provider can refer to a service unit within the overall service system that can provide specific functions or data to other components or users. For example, a database service provider provides data read and write services for other services that require data storage and retrieval functions; a payment gateway service provider provides payment processing functions for the transaction module in an e-commerce system.

[0071] Optionally, a service consumer can refer to a component or module in the system that relies on services provided by other service providers to complete its own functions. The service consumer can obtain the required services by communicating and interacting with the service provider. For example, in an online video playback system, the video playback interface, as a service consumer, needs to obtain video data from the video streaming service provider and advertising information from the advertising service provider to display to the user.

[0072] Optionally, based on the server mapping relationship between the production environment and the load testing environment, as well as the addresses of each service provider and each service consumer in the production environment, the addresses of each service provider and each service consumer in the load testing environment can be determined.

[0073] Optionally, the registration and subscription information records detailed information about the service consumer's subscription to the service provider. Based on this subscription information, a mapping between the two can be established in the load testing environment. For example, if an order management service consumer subscribes to a user authentication service provider, then in the load testing environment, by searching the relevant records in the registration and subscription information, the addresses of these two services can be determined, and a network connection can be established between them. This network connection can be a socket connection based on the TCP / IP protocol, or it can be a connection implemented through other specific communication protocols; no limitation is made here.

[0074] S140. Configure each service provider and service consumer in the load testing environment to connect to the registry center in the load testing environment, and start each service provider and service consumer in the load testing environment to register and subscribe, so as to complete the configuration of the load testing environment.

[0075] Optionally, after completing the connection configuration with the registry center, the service provider starts according to its own startup script or command. During the startup process, the service provider will first initialize its own service resources, such as loading configuration files and starting relevant background threads. Then, the service provider will send a registration request to the registry center according to the configuration, registering its service name, address, port and other information with the registry center. For example, a service provider that provides user authentication services will register the service name "user-authentication-service" as well as its own running IP address (such as 192.168.1.20) and port number (such as 8080) with the registry center so that service consumers can discover and call it.

[0076] Optionally, when a service consumer starts up, it will also initialize its own resources first. After starting up, the service consumer will immediately try to connect to the registry center to obtain information about the service providers it depends on, so that it can correctly call these services in subsequent business processes.

[0077] Optionally, once a service provider successfully registers with the registry center, the registry center will store and manage the service provider's information. After obtaining the service provider's information from the registry center, the service consumer will establish a subscription relationship with the service provider.

[0078] The technical solution of this invention, by determining the server mapping relationship between the production environment and the stress testing environment, deploys a registration center cluster of the same scale as the production environment in the stress testing environment, determines the addresses of each service provider and each service consumer in the stress testing environment based on the registration and subscription information, establishes the correspondence between each service provider and each service consumer in the stress testing environment, configures each service provider and each service consumer in the stress testing environment to connect to the registration center in the stress testing environment, and starts each service provider and each service consumer in the stress testing environment to perform registration and subscription, can simulate microservice calls of the full data of the production environment. Based on a small number of servers in the existing stress testing environment, it replicates the actual registration and subscription situation of microservices in the production environment, so that the test environment can perform stress testing at the production scale or a multiple of the production scale.

[0079] Example 2

[0080] Figure 2 This is a flowchart illustrating a method for configuring a load testing environment based on a small number of test servers, according to Embodiment 2 of the present invention. Building upon the previous embodiments, this embodiment specifically describes a method for configuring a load testing environment using a small number of test servers. Figure 2 As shown, the method includes:

[0081] S210. Obtain the registration and subscription information for the production environment.

[0082] S220. Determine the load testing scaling ratio based on the number of production servers in the production environment and the number of test servers in the load testing environment.

[0083] Optionally, production servers in a production environment can refer to servers used to deploy service providers and service consumers in the production environment, while test servers can refer to all servers in the test environment. Test servers in the test environment can be used to simulate production servers and deploy the registry cluster. Provided that the scale of the registry cluster meets the requirements, the remaining test servers can be used to simulate production servers.

[0084] Optionally, if the service provider in the production environment is a cluster architecture consisting of multiple servers, the load testing environment can be simplified or simulated according to testing needs. For example, if the production environment has a cluster of 10 production servers providing services, 1-2 test servers can be used in the load testing environment to simulate this cluster and distribute the request load across these servers.

[0085] Optionally, you can first determine the number of target test servers that can be used to simulate production servers based on the number of test servers and the size of the registry cluster. Then, calculate the load testing ratio based on the number of production servers and the number of target test servers. For example, if there are 10 production servers and 2 target load testing servers, the load testing scaling ratio can be 5.

[0086] S230. Based on the scaling ratio, establish a mapping relationship between multiple first servers in the production environment and second servers in the load testing environment.

[0087] Optionally, the second server can refer to a specific test server in the load testing environment, and the first server can refer to various production servers in the production environment that are mapped to the same load testing server. The use of the first server and the second server here is only to show that in this scenario, multiple production servers in the production environment need to be mapped to the same load testing server.

[0088] S240. Create multiple nodes in the second server and establish a one-to-one mapping relationship between the nodes and the first server.

[0089] Optionally, when multiple production servers are mapped to the same load testing server, multiple nodes can be created in the load testing server. Nodes can refer to simulated server nodes, and a unique internal IP address can be assigned to each simulated server node through the server's virtual network configuration tool.

[0090] It is understandable that once the mapping relationship between the first server and the second server, as well as the nodes of the second server, is determined, the one-to-one mapping relationship between the nodes and the first server can be determined.

[0091] Optionally, each node in the second server has a corresponding relationship with one of the first servers.

[0092] S250. Based on the size of the registry cluster in the production environment, deploy a registry cluster of the same size in the stress testing environment.

[0093] S260. Replay the registration and subscription information in the stress testing environment to form the data foundation of the stress testing environment, and determine the first server address of each service provider and each service consumer in the production environment based on the registration and subscription information.

[0094] S270. Based on the mapping relationship between each node in the stress testing environment and each production server in the production environment, as well as the address of the first server, determine the node addresses of each service provider and each service consumer in the stress testing environment.

[0095] Optionally, when there are multiple test servers in the load testing environment, and multiple nodes are established in each server, the mapping relationship between each node in the load testing environment and each production server in the production environment can be determined based on the mapping relationship between each node in the second server and the first server.

[0096] S280. Based on the correspondence between service providers and service consumers in the production environment, establish a one-to-one correspondence between service providers and service consumers in the stress testing environment.

[0097] S290. Configure each service provider and service consumer in the load testing environment to connect to the registry center in the load testing environment, and start each service provider and service consumer in the load testing environment to register and subscribe, so as to complete the configuration of the load testing environment.

[0098] The technical solution of this invention establishes a mapping relationship between multiple first servers in the production environment and second servers in the load testing environment according to the scaling ratio. Multiple nodes are created in the second servers, and a one-to-one mapping relationship is established between the nodes and the first servers. A registration center cluster of the same scale as the production environment is deployed in the load testing environment. Based on the registration and subscription information, the addresses of each service provider and service consumer in the load testing environment are determined, and a correspondence is established between each service provider and service consumer in the load testing environment. Furthermore, each service provider and service consumer in the load testing environment is configured to connect to the registration center in the load testing environment, and the registration and subscription of each service provider and service consumer in the load testing environment is initiated. This method simulates microservice calls to the full data of the production environment. Based on a small number of servers in the existing load testing environment, the actual registration and subscription situation of microservices in the production environment is replicated, so that the test environment can perform load testing at a production scale.

[0099] Example 3

[0100] Figure 3 This is a flowchart illustrating a method for configuring a load testing environment according to Embodiment 3 of the present invention. Based on the above embodiments, this embodiment specifically describes a method for configuring a load testing environment during full-scale capacity expansion load testing. Figure 3 As shown, the method includes:

[0101] S310. Obtain the registration and subscription information for the production environment.

[0102] S320. When performing a full capacity expansion load test, determine the load test scaling ratio based on the number of production servers after expansion in the production environment and the number of test servers in the load test environment.

[0103] Optionally, full capacity expansion stress testing can refer to stress testing on the basis of simulating the production environment by increasing the server resources, storage resources, etc. of the production environment by a certain proportion, with the aim of evaluating the system's performance after expansion.

[0104] S330. Based on the scaling ratio, establish a mapping relationship between the first server in the production environment and multiple second servers in the load testing environment.

[0105] Optionally, the first server can refer to a specific production server in the production environment, and the second server can refer to various test servers that have a mapping relationship with the first server. During full-scale load testing, one production server can be mapped to multiple test servers.

[0106] S340. Based on the size of the registry cluster in the production environment, deploy a registry cluster of the same size in the stress testing environment.

[0107] S350. Replay the registration and subscription information in the stress testing environment to form the data foundation of the stress testing environment, and determine the first server address of each service provider and each service consumer in the production environment based on the registration and subscription information.

[0108] S360. When performing a full-scale load test, the second server addresses of each service provider and each service consumer in the load test environment are determined based on the mapping relationship between each test server in the load test environment and each production server in the production environment, as well as the first server address.

[0109] S370. Based on the correspondence between service providers and service consumers in the production environment, establish a one-to-one correspondence between service providers and service consumers in the stress testing environment.

[0110] S380: Configure each service provider and service consumer in the load testing environment to connect to the registry center in the load testing environment, and start each service provider and service consumer in the load testing environment to register and subscribe, so as to complete the configuration of the load testing environment.

[0111] The technical solution of this invention establishes a mapping relationship between a first server in the production environment and multiple second servers in the load testing environment according to a scaling ratio. A registration center cluster of the same scale as in the production environment is deployed in the load testing environment. Based on registration and subscription information, the addresses of each service provider and service consumer in the load testing environment are determined, and a correspondence is established between them. Furthermore, each service provider and service consumer in the load testing environment is configured to connect to the registration center in the load testing environment, and the registration and subscription processes are initiated. This method simulates microservice calls based on full data from the production environment, replicating the actual registration and subscription status of microservices in the production environment, allowing the test environment to perform load testing at a scale many times larger than production.

[0112] Example 4

[0113] Figure 4 This is a flowchart illustrating a method for configuring a stress testing environment according to Embodiment 4 of the present invention. Based on the above embodiments, this embodiment specifically describes a method for configuring a stress testing environment when expanding the call link. Figure 4 As shown, the method includes:

[0114] S410: Obtain the registration and subscription information for the production environment, as well as the load testing scaling ratio.

[0115] S420. When performing link expansion stress testing, determine at least one target service to be expanded in the production environment and the target link to which the target service belongs, based on the link expansion parameters, and determine the call topology of the target link based on the registration and subscription information.

[0116] Optionally, link expansion stress testing can refer to the performance evaluation of a specific business link under capacity expansion. It is mainly to simulate the changes in the response capability, throughput, resource utilization and other indicators of the business link under high load and high traffic conditions when some services or resources in the system are expanded (such as increasing the number of servers, increasing the number of service instances, etc.). This is to identify potential problems in advance and optimize the system architecture and configuration to ensure that the system can run stably and efficiently after expansion.

[0117] Optionally, the link expansion parameters can be used to determine a series of settings for which aspects need to be expanded and the extent of expansion in the link expansion stress test. These may include the percentage increase in the number of service instances, the scale of server resource expansion (such as the increase in CPU and memory), and the increase in network bandwidth. This is only an example and is not specifically limited.

[0118] Optionally, a link is a business process path consisting of a series of interconnected and collaborative services. Once the target service to be expanded is determined, the target link to which it belongs can be determined.

[0119] Optionally, the call topology describes the hierarchical structure and relationship network of mutual calls between various services in the system. It shows the complete path from one or more starting services, through a series of intermediate service calls, to the final target service, as well as information such as the call order and dependencies between services.

[0120] S430. Based on the call topology of the target link, determine each production server belonging to the target link in the production environment, and determine the expansion scale of the target service based on the link expansion parameters.

[0121] Optionally, after determining the call topology of the target link, the upstream and downstream services of the target service can be determined based on the call topology, and then the production servers belonging to the target link can be determined based on the registration and subscription information.

[0122] S440. Based on the production servers in the target link and the expansion scale of the target service, determine the target servers in the expanded target link and establish the mapping relationship between each target server and each second server in the stress test environment.

[0123] Optionally, the second server can refer to a test server in the stress testing environment that can be used to establish a mapping relationship with the production server.

[0124] Optionally, when testing the target link, system resources of non-target links in the test environment can be released to simulate the addition of a new production server.

[0125] S450. Based on the size of the registry cluster in the production environment, deploy a registry cluster of the same size in the stress testing environment.

[0126] S460. Based on the registration and subscription information, determine the addresses of each service provider and each service consumer in the load testing environment, and establish the correspondence between each service provider and each service consumer in the load testing environment.

[0127] S470 Configure each service provider and service consumer in the load testing environment to connect to the registry center in the load testing environment, and start each service provider and service consumer in the load testing environment to register and subscribe, so as to complete the configuration of the load testing environment.

[0128] The technical solution of this invention, during link expansion load testing, determines at least one target service to be expanded in the production environment and the target link to which the target service belongs, based on link expansion parameters. It then determines the call topology of the target link based on registration and subscription information. Based on the call topology of the target link, it identifies each production server belonging to the target link in the production environment. Finally, based on the link expansion parameters, it determines the expansion scale of the target service. Finally, based on each production server in the target link and the expansion scale of the target service, it determines each target server in the expanded target link and establishes a mapping relationship between each target server and each second server in the load testing environment. Deploying a registry cluster of the same size as the production environment in the load testing environment, and determining the addresses of each service provider and service consumer in the load testing environment based on the registration and subscription information, establishing the correspondence between each service provider and service consumer in the load testing environment, configuring each service provider and service consumer in the load testing environment to connect to the registry in the load testing environment, and starting each service provider and service consumer in the load testing environment to perform registration and subscription can comprehensively verify the system stability of the target link after expansion, help verify the scalability of the system, and conduct targeted load testing to discover the performance bottlenecks of the target service after expansion in advance.

[0129] Example 5

[0130] Figure 5 This is a schematic diagram of the configuration device for a pressure testing environment provided in Embodiment 5 of the present invention. Figure 5 As shown, the device includes: a server mapping module 510, a registration center cluster deployment module 520, a service correspondence establishment module 530, and a connection startup module 540.

[0131] Server mapping module 510 is used to obtain the registration and subscription information of the production environment and the load testing scaling ratio, and determine the server mapping relationship between the production environment and the load testing environment according to the scaling ratio.

[0132] The Registration Center Cluster Deployment Module 520 is used to deploy a Registration Center Cluster of the same size in the stress testing environment, based on the size of the Registration Center Cluster in the production environment.

[0133] The service correspondence establishment module 530 is used to determine the addresses of each service provider and each service consumer in the stress testing environment based on the registration and subscription information, and to establish the correspondence between each service provider and each service consumer in the stress testing environment.

[0134] The connection startup module 540 is used to configure each service provider and each service consumer in the stress testing environment to connect to the registration center in the stress testing environment, and to start each service provider and each service consumer in the stress testing environment to register and subscribe, so as to complete the configuration of the stress testing environment.

[0135] The technical solution of this invention, by determining the server mapping relationship between the production environment and the stress testing environment, deploys a registration center cluster of the same scale as the production environment in the stress testing environment, determines the addresses of each service provider and each service consumer in the stress testing environment based on the registration and subscription information, establishes the correspondence between each service provider and each service consumer in the stress testing environment, configures each service provider and each service consumer in the stress testing environment to connect to the registration center in the stress testing environment, and starts each service provider and each service consumer in the stress testing environment to perform registration and subscription, can simulate microservice calls of the full data of the production environment. Based on a small number of servers in the existing stress testing environment, it replicates the actual registration and subscription situation of microservices in the production environment, so that the test environment can perform stress testing at the production scale or a multiple of the production scale.

[0136] Based on the above embodiments, the server mapping module 510 can be used for:

[0137] Determine the load testing scaling ratio based on the number of production servers in the production environment and the number of test servers in the load testing environment;

[0138] Based on the scaling ratio, establish a mapping relationship between multiple first servers in the production environment and second servers in the load testing environment;

[0139] Multiple nodes are created in the second server, and a one-to-one mapping relationship is established between the nodes and the first server.

[0140] Based on the above embodiments, the service correspondence establishment module 530 can be used for:

[0141] The registration and subscription information is replayed in the stress testing environment to form the data foundation of the stress testing environment, and the first server addresses of each service provider and each service consumer in the production environment are determined based on the registration and subscription information.

[0142] Based on the mapping relationship between each node in the stress testing environment and each production server in the production environment, as well as the address of the first server, determine the node addresses of each service provider and each service consumer in the stress testing environment.

[0143] Based on the correspondence between service providers and service consumers in the production environment, establish a one-to-one correspondence between service providers and service consumers in the stress testing environment.

[0144] Based on the above embodiments, the server mapping module 510 can also be used for:

[0145] When performing full capacity expansion load testing, the load testing scaling ratio is determined based on the number of production servers after expansion in the production environment and the number of test servers in the load testing environment.

[0146] Based on the scaling ratio, establish a mapping relationship between the first server in the production environment and multiple second servers in the load testing environment.

[0147] Based on the above embodiments, the service correspondence establishment module 530 can be used for:

[0148] The registration and subscription information is replayed in the stress testing environment to form the data foundation of the stress testing environment, and the first server addresses of each service provider and each service consumer in the production environment are determined based on the registration and subscription information.

[0149] When performing a full-scale load test, the second server addresses of each service provider and each service consumer in the load test environment are determined based on the mapping relationship between each test server in the load test environment and each production server in the production environment, as well as the first server address.

[0150] Based on the correspondence between service providers and service consumers in the production environment, establish a one-to-one correspondence between service providers and service consumers in the stress testing environment.

[0151] Based on the above embodiments, the server mapping module 510 can also be used for:

[0152] When performing link expansion stress testing, at least one target service to be expanded in the production environment and the target link to which the target service belongs are determined according to the link expansion parameters, and the call topology of the target link is determined according to the registration and subscription information.

[0153] Based on the call topology of the target link, identify each production server belonging to the target link in the production environment, and determine the expansion scale of the target service based on the link expansion parameters.

[0154] Based on the production servers in the target link and the expansion scale of the target service, determine the target servers in the expanded target link and establish the mapping relationship between each target server and each second server in the stress test environment.

[0155] The stress testing environment configuration device provided in the embodiments of the present invention can execute the stress testing environment configuration method provided in any embodiment of the present invention, and has the corresponding functional modules and beneficial effects of the execution method.

[0156] Example 6

[0157] Figure 6 A schematic diagram of an electronic device 10 that can be used to implement embodiments of the present invention is shown. The electronic device is intended to represent various forms of digital computers, such as laptop computers, desktop computers, workstations, personal digital assistants, servers, blade servers, mainframe computers, and other suitable computers. The electronic device can also represent various forms of mobile devices, such as personal digital processors, cellular phones, smartphones, wearable devices (e.g., helmets, glasses, watches, etc.), and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely illustrative and are not intended to limit the implementation of the invention described and / or claimed herein.

[0158] like Figure 6 As shown, the electronic device 10 includes at least one processor 11 and a memory, such as a read-only memory (ROM) 12 or a random access memory (RAM) 13, communicatively connected to the at least one processor 11. The memory stores computer programs executable by the at least one processor. The processor 11 can perform various appropriate actions and processes based on the computer program stored in the ROM 12 or loaded from storage unit 18 into the RAM 13. The RAM 13 may also store various programs and data required for the operation of the electronic device 10. The processor 11, ROM 12, and RAM 13 are interconnected via a bus 14. An input / output (I / O) interface 15 is also connected to the bus 14.

[0159] Multiple components in electronic device 10 are connected to I / O interface 15, including: input unit 16, such as keyboard, mouse, etc.; output unit 17, such as various types of displays, speakers, etc.; storage unit 18, such as disk, optical disk, etc.; and communication unit 19, such as network card, modem, wireless transceiver, etc. Communication unit 19 allows electronic device 10 to exchange information / data with other devices through computer networks such as the Internet and / or various telecommunications networks.

[0160] Processor 11 can be various general-purpose and / or special-purpose processing components with processing and computing capabilities. Some examples of processor 11 include, but are not limited to, central processing unit (CPU), graphics processing unit (GPU), various special-purpose artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any suitable processor, controller, microcontroller, etc. Processor 11 performs the various methods and processes described above, such as the configuration method of the stress testing environment as described in the embodiments of the present invention. That is:

[0161] Obtain the registration and subscription information and load testing scaling ratio of the production environment, and determine the server mapping relationship between the production environment and the load testing environment based on the scaling ratio;

[0162] Based on the size of the registry cluster in the production environment, deploy a registry cluster of the same size in the stress testing environment;

[0163] Based on the registration and subscription information, determine the addresses of each service provider and each service consumer in the stress testing environment, and establish the correspondence between each service provider and each service consumer in the stress testing environment;

[0164] Configure each service provider and service consumer in the load testing environment to connect to the registry center in the load testing environment, and start each service provider and service consumer in the load testing environment to register and subscribe, so as to complete the configuration of the load testing environment.

[0165] In some embodiments, the method for configuring the stress testing environment may be implemented as a computer program tangibly contained in a computer-readable storage medium, such as storage unit 18. In some embodiments, part or all of the computer program may be loaded and / or installed on electronic device 10 via ROM 12 and / or communication unit 19. When the computer program is loaded into RAM 13 and executed by processor 11, one or more steps of the method for configuring the stress testing environment described above may be performed. Alternatively, in other embodiments, processor 11 may be configured to perform the method for configuring the stress testing environment by any other suitable means (e.g., by means of firmware).

[0166] Various embodiments of the systems and techniques described above herein can be implemented in digital electronic circuit systems, integrated circuit systems, field-programmable gate arrays (FPGAs), application-specific integrated circuits (ASICs), application-specific standard products (ASSPs), systems-on-a-chip (SoCs), payload-programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various embodiments may include implementations in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which may be a dedicated or general-purpose programmable processor, capable of receiving data and instructions from a storage system, at least one input device, and at least one output device, and transmitting data and instructions to the storage system, the at least one input device, and the at least one output device.

[0167] Computer programs used to implement the methods of the present invention may be written in any combination of one or more programming languages. These computer programs may be provided to a processor of a general-purpose computer, a special-purpose computer, or other programmable data processing device, such that when executed by the processor, the computer programs cause the functions / operations specified in the flowcharts and / or block diagrams to be performed. The computer programs may be executed entirely on a machine, partially on a machine, or as a standalone software package, partially on a machine and partially on a remote machine, or entirely on a remote machine or server.

[0168] In the context of this invention, a computer-readable storage medium can be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, apparatus, or device. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, apparatus, or devices, or any suitable combination thereof. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. More specific examples of machine-readable storage media include electrical connections based on one or more wires, portable computer disks, hard disks, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fibers, portable compact disk read-only memory (CD-ROM), optical storage devices, magnetic storage devices, or any suitable combination thereof.

[0169] To provide interaction with a user, the systems and techniques described herein can be implemented on an electronic device having: a display device (e.g., a CRT (cathode ray tube) or LCD (liquid crystal display) monitor) for displaying information to the user; and a keyboard and pointing device (e.g., a mouse or trackball) through which the user provides input to the electronic device. Other types of devices can also be used to provide interaction with the user; for example, feedback provided to the user can be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user can be received in any form (including sound input, voice input, or tactile input).

[0170] The systems and technologies described herein can be implemented in computing systems that include backend components (e.g., as data servers), or computing systems that include middleware components (e.g., application servers), or computing systems that include frontend components (e.g., user computers with graphical user interfaces or web browsers through which users can interact with implementations of the systems and technologies described herein), or any combination of such backend, middleware, or frontend components. The components of the system can be interconnected via digital data communication of any form or medium (e.g., communication networks). Examples of communication networks include local area networks (LANs), wide area networks (WANs), blockchain networks, and the Internet.

[0171] A computing system can include clients and servers. Clients and servers are generally located far apart and typically interact through communication networks. The client-server relationship is created by computer programs running on the respective computers and having a client-server relationship with each other. The server can be a cloud server, also known as a cloud computing server or cloud host, which is a hosting product within the cloud computing service system to address the shortcomings of traditional physical hosts and VPS services, such as high management difficulty and weak business scalability.

[0172] It should be understood that the various forms of processes shown above can be used, with steps reordered, added, or deleted. For example, the steps described in this invention can be executed in parallel, sequentially, or in different orders, as long as the desired result of the technical solution of this invention can be achieved, and no limitation is imposed herein.

[0173] The specific embodiments described above do not constitute a limitation on the scope of protection of this invention. Those skilled in the art should understand that various modifications, combinations, sub-combinations, and substitutions can be made according to design requirements and other factors. Any modifications, equivalent substitutions, and improvements made within the spirit and principles of this invention should be included within the scope of protection of this invention.

Claims

1. A method for configuring a stress testing environment, characterized in that, include: Obtain the registration and subscription information and load testing scaling ratio of the production environment, and determine the server mapping relationship between the production environment and the load testing environment based on the scaling ratio; Based on the size of the registry cluster in the production environment, deploy a registry cluster of the same size in the stress testing environment; Based on the registration and subscription information, determine the addresses of each service provider and each service consumer in the stress testing environment, and establish the correspondence between each service provider and each service consumer in the stress testing environment; Configure each service provider and service consumer in the load testing environment to connect to the registry center in the load testing environment, and start each service provider and service consumer in the load testing environment to register and subscribe, so as to complete the configuration of the load testing environment; The process of obtaining the load testing scaling ratio and determining the server mapping relationship between the production environment and the load testing environment based on the scaling ratio includes: Determine the load testing scaling ratio based on the number of production servers in the production environment and the number of test servers in the load testing environment; Based on the scaling ratio, establish a mapping relationship between multiple first servers in the production environment and second servers in the load testing environment; Multiple nodes are created in the second server, and a one-to-one mapping relationship is established between the nodes and the first server.

2. The method according to claim 1, characterized in that, Based on the registration and subscription information, determine the addresses of each service provider and each service consumer in the load testing environment, and establish the correspondence between each service provider and each service consumer in the load testing environment, including: The registration and subscription information is replayed in the stress testing environment to form the data foundation of the stress testing environment, and the first server addresses of each service provider and each service consumer in the production environment are determined based on the registration and subscription information. Based on the mapping relationship between each node in the stress testing environment and each production server in the production environment, as well as the address of the first server, determine the node addresses of each service provider and each service consumer in the stress testing environment. Based on the correspondence between service providers and service consumers in the production environment, establish a one-to-one correspondence between service providers and service consumers in the stress testing environment.

3. The method according to claim 1, characterized in that, Obtain the load testing scaling ratio and determine the server mapping relationship between the production environment and the load testing environment based on the scaling ratio, including: When performing full capacity expansion load testing, the load testing scaling ratio is determined based on the number of production servers after expansion in the production environment and the number of test servers in the load testing environment. Based on the scaling ratio, establish a mapping relationship between the first server in the production environment and multiple second servers in the load testing environment.

4. The method according to claim 3, characterized in that, Based on the registration and subscription information, determine the addresses of each service provider and each service consumer in the load testing environment, and establish the correspondence between each service provider and each service consumer in the load testing environment, including: The registration and subscription information is replayed in the stress testing environment to form the data foundation of the stress testing environment, and the first server addresses of each service provider and each service consumer in the production environment are determined based on the registration and subscription information. When performing a full-scale load test, the second server addresses of each service provider and each service consumer in the load test environment are determined based on the mapping relationship between each test server in the load test environment and each production server in the production environment, as well as the first server address. Based on the correspondence between service providers and service consumers in the production environment, establish a one-to-one correspondence between service providers and service consumers in the stress testing environment.

5. The method according to claim 1, characterized in that, Determine the server mapping relationship between the production environment and the load testing environment, including: When performing link expansion stress testing, at least one target service to be expanded in the production environment and the target link to which the target service belongs are determined according to the link expansion parameters, and the call topology of the target link is determined according to the registration and subscription information. Based on the call topology of the target link, identify each production server belonging to the target link in the production environment, and determine the expansion scale of the target service based on the link expansion parameters. Based on the production servers in the target link and the expansion scale of the target service, determine the target servers in the expanded target link and establish the mapping relationship between each target server and each second server in the stress test environment.

6. A configuration device for a pressure testing environment, characterized in that, include: The server mapping module is used to obtain the registration and subscription information and load testing scaling ratio of the production environment, and determine the server mapping relationship between the production environment and the load testing environment based on the scaling ratio. The registry cluster deployment module is used to deploy a registry cluster of the same size in the stress testing environment, based on the size of the registry cluster in the production environment. The service correspondence establishment module is used to determine the addresses of each service provider and each service consumer in the stress testing environment based on the registration and subscription information, and to establish the correspondence between each service provider and each service consumer in the stress testing environment. The connection startup module is used to configure each service provider and each service consumer in the stress testing environment to connect to the registry center in the stress testing environment, and to start each service provider and each service consumer in the stress testing environment to register and subscribe, so as to complete the configuration of the stress testing environment. The server mapping module is used for: Determine the load testing scaling ratio based on the number of production servers in the production environment and the number of test servers in the load testing environment; Based on the scaling ratio, establish a mapping relationship between multiple first servers in the production environment and second servers in the load testing environment; Multiple nodes are created in the second server, and a one-to-one mapping relationship is established between the nodes and the first server.

7. An electronic device, characterized in that, The electronic device includes: At least one processor; and A memory communicatively connected to the at least one processor; wherein, The memory stores a computer program that can be executed by the at least one processor, the computer program being executed by the at least one processor to enable the at least one processor to perform the configuration method of the stress testing environment according to any one of claims 1-5.

8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores computer instructions that are used to cause a processor to execute the configuration method of the stress testing environment according to any one of claims 1-5.

9. A computer program product, characterized in that, The computer program product includes a computer program that, when executed by a processor, implements the configuration method for the stress testing environment according to any one of claims 1-5.

Citation Information

Patent Citations

  • Pressure measuring method and system

    CN115037655A

  • Distributed testing service

    US10498625B1