Pressure measurement environment configuration method, device, equipment, medium and program product

By replicating the microservice registration and subscription status of the production environment in the pressure measurement environment, the problem of the inability to accurately simulate the production environment in the prior art is solved, and a high-accurate pressure measurement environment configuration is achieved, ensuring the reliability and stability of microservice applications.

CN119520336AActive Publication Date: 2025-02-25INDUSTRIAL AND COMMERCIAL BANK OF CHINA
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
CN202411704837.4
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-11-26
Publication Date
2025-02-25
Estimated Expiration
2044-11-26

AI Technical Summary

Technical Problem

The existing pressure testing environment cannot accurately replicate the microservice registration subscription data in the production environment, resulting in the test scale far lower than the production service volume, which cannot truly reflect the actual situation in production, affecting the reliability and stability of microservice applications.

Method used

By obtaining the registration subscription information of the production environment and the pressure measurement scaling ratio, determine the server mapping relationship between the production environment and the pressure measurement environment, deploy the same-scale registration center cluster in the pressure measurement environment, determine the addresses of each service provider and service consumer based on the registration subscription information, and establish a correspondence between them, configure them to connect to the registration center and register and subscribe to complete the configuration of the pressure measurement environment.

Benefits of technology

It realizes the actual registration subscription status of the production environment microservices in the test environment, allowing the test environment to be tested at the production scale or exponentially than the production scale, ensuring the accuracy of the test results and the performance evaluation of the production environment.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119520336A_ABST
    Figure CN119520336A_ABST
Patent Text Reader

Abstract

The invention discloses a pressure measurement environment configuration method, device and equipment, a medium and a program product. Comprising the following steps: determining a server mapping relationship between a production environment and a pressure measurement environment; according to the scale of the registration center cluster in the production environment, deploying the registration center cluster with the same scale in the pressure measurement environment; according to the registration subscription information, determining addresses of each service provider and each service consumer in the pressure measurement environment, and establishing a corresponding relationship between each service provider and each service consumer in the pressure measurement environment; and configuring each service provider and each service consumer in the pressure measurement environment to be connected with a registration center in the pressure measurement environment, and starting each service provider and each service consumer in the pressure measurement environment to perform registration and subscription. According to the technical scheme, the method can be applied to the field of distributed technologies, and the actual registration and subscription conditions of the production environment micro-service can be copied in the test environment, so that the test environment is subjected to pressure measurement according to the production scale or multiplied by the production scale.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of distributed technology, and in particular to a configuration method, device, equipment, medium and program product for a stress testing environment. Background Art

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

[0003] For the existing stress testing environment, the microservice registration center cannot accurately replicate the registration subscription data in actual production to perform effective stress testing. In addition, 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 lead to the inability to truly reflect the actual situation in production, making it helpless when dealing with production service call performance issues, seriously affecting the reliability and stability of microservice applications. Summary of the invention

[0004] The present invention provides a configuration method, device, equipment, medium and program product for a stress testing environment, which can be applied to the field of distributed technology and can replicate the actual registration and subscription status of microservices in a production environment in a test environment, so that the test environment can be stress tested at the production scale, or multiples 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] Obtaining the registration subscription information and stress test scaling ratio of the production environment, and determining the server mapping relationship between the production environment and the stress test environment according to the scaling ratio;

[0007] Deploy a registry center cluster of the same size in the stress testing environment based on the size of the registry center cluster in the production environment.

[0008] According to the registration subscription information, determine the addresses of each service provider and each service consumer in the stress testing environment, and establish a corresponding relationship between each service provider and each service consumer in the stress testing environment;

[0009] 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 start each service provider and each service consumer in the stress testing environment to register and subscribe to complete the configuration of the stress testing environment.

[0010] Optionally, obtaining a stress test scaling ratio, and determining a server mapping relationship between a production environment and a stress test environment according to the scaling ratio, includes:

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

[0012] According to the scaling ratio, a mapping relationship is established between the plurality of first servers in the production environment and the second servers in the stress testing environment;

[0013] A plurality of 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 advantage of this setting is that it can reasonably arrange stress testing resources based on the comparison between the actual number of test servers and the number of production servers, so that the enterprise can obtain accurate assessment of system performance at a lower cost during the testing phase, thereby maximizing cost-effectiveness. A mapping relationship between servers is established based on the scaling ratio, so that the stress testing environment can scientifically simulate the load conditions of the production environment.

[0015] Optionally, according to the registration subscription information, determining the addresses of each service provider and each service consumer in the stress testing environment, and establishing a corresponding relationship between each service provider and each service consumer in the stress testing environment, including:

[0016] Replaying the registration subscription information in the stress testing environment to form a data basis for the stress testing environment, and determining the first server address of each service provider and each service consumer in the production environment according to the registration subscription information;

[0017] Determine the node addresses of each service provider and each service consumer in the stress testing environment according to the mapping relationship between each node in the stress testing environment and each production server in the production environment and the first server address;

[0018] According to the correspondence between each service provider and each service consumer in the production environment, a one-to-one correspondence between each service provider and each service consumer in the stress testing environment is established.

[0019] The advantage of this setting is that by replaying the registration and subscription information in the stress testing environment to form a data foundation, the data distribution and business logic relationship of the stress testing environment can be highly consistent with the production environment. The node addresses of each service provider and service consumer in the stress testing environment are determined according to the mapping relationship between the stress testing environment and the production environment and the first server address, which can achieve accurate address conversion and ensure that in the stress testing environment, the service providers and service consumers can communicate according to the logic similar to the production environment, establish a one-to-one correspondence between each service provider and each service consumer in the stress testing environment, and completely restore the service interaction relationship in the production environment.

[0020] Optionally, obtaining a stress test scaling ratio, and determining a server mapping relationship between a production environment and a stress test environment according to the scaling ratio, includes:

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

[0022] According to the scaling ratio, a mapping relationship is established between the first server in the production environment and the plurality of second servers in the stress testing environment.

[0023] The benefits of this setting are: it can better simulate the production environment under the expansion scenario, accurately analyze the expansion of the production environment, and more realistically test the performance of the system after full expansion, such as key indicators such as system throughput and response time. This makes the stress test results more valuable for practical applications and helps enterprises discover potential performance bottlenecks in advance.

[0024] Optionally, according to the registration subscription information, determining the addresses of each service provider and each service consumer in the stress testing environment, and establishing a corresponding relationship between each service provider and each service consumer in the stress testing environment, including:

[0025] Replaying the registration subscription information in the stress testing environment to form a data basis for the stress testing environment, and determining the first server address of each service provider and each service consumer in the production environment according to the registration subscription information;

[0026] When performing full capacity expansion stress testing, determining the second server addresses of each service provider and each service consumer in the stress testing environment according to the mapping relationship between each test server in the stress testing environment and each production server in the production environment and the first server address;

[0027] According to the correspondence between each service provider and each service consumer in the production environment, a one-to-one correspondence between each service provider and each service consumer in the stress testing environment is established.

[0028] The advantage of this setting is that by replaying the registration and subscription information in the stress testing environment to form a data foundation, the data distribution and business logic relationship of the stress testing environment can be highly consistent with the production environment, and accurate address conversion can be achieved in the full capacity expansion scenario. It ensures that in the stress testing environment, the service provider and service consumer can communicate according to the logic similar to the production environment, establish a one-to-one correspondence between each service provider and each service consumer in the stress testing environment, and completely restore the service interaction relationship in the production environment.

[0029] Optionally, determine the server mapping relationship between the production environment and the stress 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 subscription information;

[0031] According to 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 according to the link expansion parameter;

[0032] According to the expansion scale of each production server in the target link and the target service, each target server in the expanded target link is determined, and a mapping relationship between each target server and each second server in the stress testing environment is established.

[0033] The advantage of this setting is that it can fully verify the system stability of the target link after capacity expansion, help verify the scalability of the system, and conduct targeted stress testing to discover the performance bottleneck of the target service after capacity expansion in advance.

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

[0035] A server mapping module is used to obtain the registration subscription information and stress test scaling ratio of the production environment, and determine the server mapping relationship between the production environment and the stress test environment according to 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] A service correspondence establishment module, used to determine the addresses of each service provider and each service consumer in the stress testing environment according to the registration subscription information, and establish a 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 stress testing environment to connect to the registration center in the stress testing environment, and start each service provider and each service consumer in the stress testing environment to register and subscribe to complete the configuration of the stress 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, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for configuring the stress testing environment described in any embodiment of the present invention.

[0043] According to another aspect of the present invention, a computer-readable storage medium is provided, wherein the computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for configuring a stress testing environment described in any embodiment of the present invention when executed.

[0044] According to another aspect of the present invention, a computer program product is provided. The computer program product includes a computer program. When the computer program is executed by a processor, the method for configuring a stress testing environment according to any embodiment of the present invention is implemented.

[0045] The technical solution of the embodiment of the present invention determines the server mapping relationship between the production environment and the stress testing environment, deploys a registration center cluster of the same scale as that in the production environment in the stress testing environment, determines the addresses of each service provider and each service consumer in the stress testing environment according to the registration subscription information, establishes the corresponding relationship 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 register and subscribe. This method can simulate the microservice call of the full data of the production environment, and replicates the actual registration and subscription status of the microservices in the production environment based on a small number of servers in the existing stress testing environment, so that the test environment can perform stress testing at the production scale, or multiples of the production scale.

[0046] It should be understood that the contents described in this section are not intended to identify the key or important features of the embodiments of the present invention, nor are they intended to limit the scope of the present invention. Other features of the present invention will become easily understood through the following description. BRIEF DESCRIPTION OF THE DRAWINGS

[0047] In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the accompanying drawings required for use in the description of the embodiments will be briefly introduced below. Obviously, the accompanying drawings in the following description are only some embodiments of the present invention. For ordinary technicians in this field, other accompanying drawings can be obtained based on these accompanying drawings without paying creative work.

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

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

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

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

[0052] Figure 5 It is a structural schematic diagram of a configuration device for a stress testing environment provided according to Embodiment 5 of the present invention;

[0053] Figure 6 It is a structural schematic diagram of an electronic device for implementing the configuration method of the stress testing environment according to an embodiment of the present invention. DETAILED DESCRIPTION

[0054] In order to enable those skilled in the art to better understand the scheme of the present invention, the technical scheme in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work 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 and claims of the present invention and the above-mentioned drawings are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence. It should be understood that the data used in this way can be interchanged where appropriate, so that the embodiments of the present invention described herein can be implemented in an order other than those illustrated or described herein. In addition, the terms "including" and "having" and any variations thereof are intended to cover non-exclusive inclusions, for example, a process, method, system, product or device that includes a series of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or inherent to these processes, methods, products or devices.

[0056] Embodiment 1

[0057] Figure 1 This is a flowchart of a method for configuring a stress testing environment provided in the first embodiment of the present invention. This embodiment can be applied to configuring a stress testing environment to implement stress testing on large-scale servers in a production environment or stress testing on production expansion scenarios. The method can be executed by a configuration device for a stress testing environment. The configuration device for a stress testing environment can be implemented in the form of hardware and / or software and can generally be configured in a computer or processor with data processing capabilities. Figure 1 As shown, the method includes:

[0058] S110: Obtain registration subscription information and a stress test scaling ratio of the production environment, and determine a server mapping relationship between the production environment and the stress test environment according to 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 a system environment used to perform stress testing on the production environment. Stress testing is a performance test that is mainly used to evaluate the performance of the system under different load conditions, such as system throughput, response time, resource utilization and other indicators.

[0060] Optionally, the registration subscription information may refer to detailed data related to the registration of a service and the subscription of other services to it in a microservice architecture, including information such as the name, address, and interface of the service.

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

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

[0063] Optionally, the stress test scaling ratio can be used to indicate the relative ratio of the server configuration in the production environment and the stress test environment. For example, if the stress test scaling ratio is 2, then two servers in the production environment are mapped to one server in the stress test environment, and two real addresses are simulated in the form of two ports; for another example, if the scaling ratio is 0.5, the full capacity expansion scenario of production can be simulated, and one server in the production environment is mapped to two servers in the stress test environment. This is only an example.

[0064] Optionally, when the number of test servers in the test environment is far less than that of 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 one test server can be distinguished by configuring different port numbers or virtual IP addresses.

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

[0066] Optionally, the registry can be used to store relevant information of microservices, such as the name, address, port, etc. of the service. Other microservices can discover and call the target microservice through the registry. The registry cluster is a collection of multiple registry nodes. The cluster can improve the availability and reliability of the registry and prevent single point failures. The scale of the registry cluster can be determined according to the number of registry nodes. For example, a production server can be configured as a registry node. In a specified production environment, three production servers can be used to configure three registry nodes. These three registry nodes constitute a registry cluster.

[0067] Optionally, in the stress test environment, in order to simulate the operating status and network topology of the production environment as realistically as possible, it is necessary to deploy according to the scale of the registry center cluster in the production environment, that is, to build a registry center cluster of the same scale as the production environment in the stress test environment. In this way, during stress testing, the registration and discovery mechanism of microservices in the stress test environment can be consistent with that in the production environment.

[0068] In a specific example, if three registration center nodes can be configured through three production servers in the production environment, then in the stress testing environment, three registration center nodes are also configured through three stress testing servers respectively to form a registration center cluster in the stress testing environment.

[0069] S130. Determine the addresses of each service provider and each service consumer in the stress testing environment according to the registration subscription information, and establish a corresponding relationship between each service provider and each service consumer in the stress testing environment.

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

[0071] Optionally, a service consumer may refer to a component or module in the system that relies on services provided by other service providers to complete its own functions. A service consumer can obtain the required services by communicating and interacting with service providers. 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 obtain advertising information from the advertising service provider to display to users.

[0072] Optionally, the addresses of each service provider and each service consumer in the stress testing environment may be determined based on a server mapping relationship between the production environment and the stress testing environment and the addresses of each service provider and each service consumer in the production environment.

[0073] Optionally, the registration subscription information records in detail the subscription of the service consumer to the service provider, and then the corresponding relationship between the two can be established in the stress test environment based on the subscription situation. For example, if an order management service consumer subscribes to the service of the user authentication service provider, then in the stress test environment, by finding the relevant records in the registration subscription information and determining the addresses of the two services, a network connection between the two is established. The network connection can be a socket connection based on the TCP / IP protocol, or a connection implemented through other specific communication protocols, which is not limited here.

[0074] S140: 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 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.

[0075] Optionally, after completing the connection configuration with the registration 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, starting related background threads, etc. Then, the service provider will send a registration request to the registration center according to the configuration, and register its own service name, address, port and other information with the registration center. For example, a service provider that provides user authentication services will register the service name "user-authentication-service" and its own running IP address (such as 192.168.1.20) and port number (such as 8080) with the registration center so that the service consumer can discover and call it.

[0076] Optionally, when the service consumer starts, it will also initialize its own resources first. After startup, the service consumer will immediately try to connect to the registration center and obtain the information of the service providers it depends on from the registration center so that these services can be called correctly in subsequent business processing.

[0077] Optionally, when the service provider successfully registers with the registration center, the registration center will store and manage the service provider's information. After the service consumer obtains the service provider's information from the registration center, it will establish a subscription relationship with the service provider.

[0078] The technical solution of the embodiment of the present invention determines the server mapping relationship between the production environment and the stress testing environment, deploys a registration center cluster of the same scale as that in the production environment in the stress testing environment, determines the addresses of each service provider and each service consumer in the stress testing environment according to the registration subscription information, establishes the corresponding relationship 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 register and subscribe. This method can simulate the microservice call of the full data of the production environment, and replicates the actual registration and subscription status of the microservices in the production environment based on a small number of servers in the existing stress testing environment, so that the test environment can perform stress testing at the production scale, or multiples of the production scale.

[0079] Embodiment 2

[0080] Figure 2 This is a flow chart of a method for configuring a stress testing environment provided by Embodiment 2 of the present invention. Based on the above embodiments, this embodiment specifically describes a method for configuring a stress testing environment based on a small number of test servers. Figure 2 As shown, the method includes:

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

[0082] S220. Determine a stress test scaling ratio according to the number of production servers in the production environment and the number of test servers in the stress test environment.

[0083] Optionally, the production server in the production environment may refer to the server used to deploy the service provider and the service consumer in the production environment, and the test server may refer to all the servers in the test environment. The test servers in the test environment can be used to simulate the production servers and deploy the registration center cluster. On the basis of ensuring that the scale of the registration center cluster can meet the requirements, the remaining test servers can be used to simulate the production servers.

[0084] Optionally, if the service provider in the production environment is a cluster architecture with multiple servers providing services, it can be simplified or simulated in the stress test environment according to the test requirements. For example, if there is a cluster of 10 production servers in the production environment to provide services, 1-2 test servers can be used in the stress test environment to simulate this cluster and balance the request load to 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 registration center cluster, and calculate the stress testing ratio based on the number of production servers and the number of target test servers. For example, in the previous example, when there are 10 production servers and 2 target stress testing servers, the stress testing scaling ratio can be 5.

[0086] S230. Establish a mapping relationship between the multiple first servers in the production environment and the second servers in the stress testing environment according to the scaling ratio.

[0087] Optionally, the second server may refer to a specific test server in the stress testing environment, and the first server may refer to the production servers in the production environment that are mapped to the same stress testing server. The first server and the second server are used here for illustration only to indicate that in this scenario, multiple production servers in the production environment need to be mapped to the same stress 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 stress testing server, multiple nodes can be created in the stress testing server. A node can refer to a simulation server node, and a unique internal IP address can be assigned to each simulation server node through the server's virtual network configuration tool.

[0090] It can be understood that after determining the mapping relationship between the first server and the second server and the node of the second server, the one-to-one mapping relationship between the node and the first server can be determined.

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

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

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

[0094] S270. Determine the node addresses of each service provider and each service consumer in the stress testing environment according to the mapping relationship between each node in the stress testing environment and each production server in the production environment and the first server address.

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

[0096] S280. According to the correspondence between each service provider and each service consumer in the production environment, a one-to-one correspondence between each service provider and each service consumer in the stress testing environment is established.

[0097] S290. 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 start each service provider and each service consumer in the stress testing environment to register and subscribe to complete the configuration of the stress testing environment.

[0098] The technical solution of the embodiment of the present invention establishes a mapping relationship between multiple first servers in the production environment and the second server in the stress testing environment according to the scaling ratio, creates multiple nodes in the second server, establishes a one-to-one mapping relationship between the node and the first server, deploys a registration center cluster of the same scale as that in the production environment in the stress testing environment, determines the addresses of each service provider and each service consumer in the stress testing environment according to the registration and subscription information, establishes a corresponding relationship 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 register and subscribe. This method can simulate the microservice call of the full data of the production environment, and replicates the actual registration and subscription status of the microservices in the production environment based on a small number of servers in the existing stress testing environment, so that the test environment can perform stress testing at the production scale.

[0099] Embodiment 3

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

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

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

[0103] Optionally, full capacity expansion stress testing can refer to increasing the server resources and storage resources of the production environment in a certain proportion and then performing stress testing on the basis of simulating the production environment. The purpose is to evaluate the performance of the system after capacity expansion.

[0104] S330. Establish a mapping relationship between a first server in the production environment and multiple second servers in the stress testing environment according to the scaling ratio.

[0105] Optionally, the first server may refer to a specific production server in the production environment, and the second server may refer to each test server that has a mapping relationship with the first server. During full capacity expansion stress testing, one production server may be mapped to multiple test servers.

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

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

[0108] S360. When performing full capacity expansion stress testing, determine the second server addresses of each service provider and each service consumer in the stress testing environment according to the mapping relationship between each test server in the stress testing environment and each production server in the production environment and the first server address.

[0109] S370. According to the correspondence between each service provider and each service consumer in the production environment, a one-to-one correspondence between each service provider and each service consumer in the stress testing environment is established.

[0110] S380. 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 start each service provider and each service consumer in the stress testing environment to register and subscribe to complete the configuration of the stress testing environment.

[0111] The technical solution of the embodiment of the present invention establishes a mapping relationship between a first server in a production environment and multiple second servers in a stress testing environment according to a scaling ratio, deploys a registration center cluster of the same scale as that in the production environment in the stress testing environment, determines the addresses of each service provider and each service consumer in the stress testing environment according to registration and subscription information, establishes a corresponding relationship 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 register and subscribe. This can simulate the microservice call of the full data of the production environment, replicate the actual registration and subscription situation of the microservices in the production environment, so that the test environment can perform stress testing at a scale multiple of the production scale.

[0112] Embodiment 4

[0113] Figure 4 This is a flowchart of a method for configuring a stress test environment provided by Embodiment 4 of the present invention. Based on the above embodiments, this embodiment specifically describes a method for configuring a stress test environment when link expansion is called. Figure 4 As shown, the method includes:

[0114] S410. Obtain registration subscription information and stress test scaling ratio of the production environment.

[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 according to the link expansion parameters, and determine the call topology of the target link according to the registration 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 indicators such as responsiveness, throughput, and resource utilization of the business link under high load and high traffic conditions when certain services or resources in the system are expanded (such as increasing the number of servers, increasing the number of service instances, etc.), so as to discover potential problems in advance and optimize the system architecture and configuration, ensuring that the system can run stably and efficiently after expansion.

[0117] Optionally, the link expansion parameters can be used to determine a series of set values ​​for which aspects need to be expanded and the degree of expansion in the link expansion stress test, which may include the increase ratio of the number of service instances, the expansion scale of server resources (such as CPU and memory increments), the increase in network bandwidth, etc. This is only an example and is not specifically limited to this.

[0118] Optionally, a link is a business process path composed of a series of interrelated and collaborative services. After 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 hierarchy and relationship network of mutual calls between services in the system. It shows the complete path from one or more starting services, through a series of intermediate service calls, to the target service, as well as the call order, dependencies, and other information between services.

[0120] S430: According to the calling 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 according to the link expansion parameter.

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

[0122] S440: Determine each target server in the target link after the expansion according to each production server in the target link and the expansion scale of the target service, and establish a mapping relationship between each target server and each second server in the stress testing environment.

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

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

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

[0126] S460. Determine the addresses of each service provider and each service consumer in the stress testing environment according to the registration subscription information, and establish a corresponding relationship between each service provider and each service consumer in the stress testing environment.

[0127] S470. 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 start each service provider and each service consumer in the stress testing environment to register and subscribe to complete the configuration of the stress testing environment.

[0128] The technical solution of the embodiment of the present invention determines at least one target service to be expanded in the production environment and the target link to which the target service belongs according to the link expansion parameters when performing link expansion stress testing, determines the call topology of the target link according to the registration subscription information, determines each production server belonging to the target link in the production environment according to the call topology of the target link, determines the expansion scale of the target service according to the link expansion parameters, determines each target server in the expanded target link according to each production server in the target link and the expansion scale of the target service, and establishes a mapping relationship between each target server and each second server in the stress testing environment. Deploy a registration center cluster of the same size as that in the production environment in the stress testing environment. According to the registration subscription information, determine the addresses of each service provider and each service consumer in the stress testing environment, establish the corresponding relationship between each service provider and each service consumer in the stress testing environment, 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 start each service provider and each service consumer in the stress testing environment to register and subscribe. This can fully verify the system stability of the target link after expansion, help verify the scalability of the system, and perform targeted stress testing to discover the performance bottleneck of the target service after expansion in advance.

[0129] Embodiment 5

[0130] Figure 5 This is a schematic diagram of a configuration device for a stress 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 initiation module 540.

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

[0132] The registry center cluster deployment module 520 is used to deploy a registry center cluster of the same size in the stress testing environment according to the size of the registry center cluster in the production environment.

[0133] The service correspondence establishing module 530 is used to determine the addresses of each service provider and each service consumer in the stress testing environment according to the registration 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 start each service provider and each service consumer in the stress testing environment to register and subscribe to complete the configuration of the stress testing environment.

[0135] The technical solution of the embodiment of the present invention determines the server mapping relationship between the production environment and the stress testing environment, deploys a registration center cluster of the same scale as that in the production environment in the stress testing environment, determines the addresses of each service provider and each service consumer in the stress testing environment according to the registration subscription information, establishes the corresponding relationship 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 register and subscribe. This method can simulate the microservice call of the full data of the production environment, and replicates the actual registration and subscription status of the microservices in the production environment based on a small number of servers in the existing stress testing environment, so that the test environment can perform stress testing at the production scale, or multiples of the production scale.

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

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

[0138] According to the scaling ratio, a mapping relationship is established between the plurality of first servers in the production environment and the second servers in the stress testing environment;

[0139] A plurality of 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 establishing module 530 can be used to:

[0141] Replaying the registration subscription information in the stress testing environment to form a data basis for the stress testing environment, and determining the first server address of each service provider and each service consumer in the production environment according to the registration subscription information;

[0142] Determine the node addresses of each service provider and each service consumer in the stress testing environment according to the mapping relationship between each node in the stress testing environment and each production server in the production environment and the first server address;

[0143] According to the correspondence between each service provider and each service consumer in the production environment, a one-to-one correspondence between each service provider and each service consumer in the stress testing environment is established.

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

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

[0146] According to the scaling ratio, a mapping relationship is established between the first server in the production environment and the plurality of second servers in the stress testing environment.

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

[0148] Replaying the registration subscription information in the stress testing environment to form a data basis for the stress testing environment, and determining the first server address of each service provider and each service consumer in the production environment according to the registration subscription information;

[0149] When performing full capacity expansion stress testing, determining the second server addresses of each service provider and each service consumer in the stress testing environment according to the mapping relationship between each test server in the stress testing environment and each production server in the production environment and the first server address;

[0150] According to the correspondence between each service provider and each service consumer in the production environment, a one-to-one correspondence between each service provider and each service consumer in the stress testing environment is established.

[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 subscription information;

[0153] According to 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 according to the link expansion parameter;

[0154] According to the expansion scale of each production server in the target link and the target service, each target server in the expanded target link is determined, and a mapping relationship between each target server and each second server in the stress testing environment is established.

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

[0156] Embodiment 6

[0157] Figure 6 A schematic diagram of the structure of an electronic device 10 that can be used to implement an embodiment 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 processing, cellular phones, smart phones, wearable devices (such as helmets, glasses, watches, etc.) and other similar computing devices. The components shown herein, their connections and relationships, and their functions are merely examples and are not intended to limit the implementation of the present invention described and / or required herein.

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

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

[0160] The processor 11 may be a variety of general and / or special processing components with processing and computing capabilities. Some examples of the processor 11 include, but are not limited to, a central processing unit (CPU), a graphics processing unit (GPU), various dedicated artificial intelligence (AI) computing chips, various processors running machine learning model algorithms, digital signal processors (DSPs), and any appropriate processors, controllers, microcontrollers, etc. The processor 11 executes the various methods and processes described above, such as the configuration method of the stress testing environment described in the embodiment of the present invention. That is:

[0161] Obtaining the registration subscription information and stress test scaling ratio of the production environment, and determining the server mapping relationship between the production environment and the stress test environment according to the scaling ratio;

[0162] Deploy a registry center cluster of the same size in the stress testing environment based on the size of the registry center cluster in the production environment.

[0163] According to the registration subscription information, determine the addresses of each service provider and each service consumer in the stress testing environment, and establish a corresponding relationship between each service provider and each service consumer in the stress testing environment;

[0164] 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 start each service provider and each service consumer in the stress testing environment to register and subscribe to complete the configuration of the stress testing environment.

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

[0166] Various implementations 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 chips (SOCs), load programmable logic devices (CPLDs), computer hardware, firmware, software, and / or combinations thereof. These various implementations can include: being implemented in one or more computer programs that can be executed and / or interpreted on a programmable system including at least one programmable processor, which can be a special purpose or general purpose programmable processor that can receive data and instructions from a storage system, at least one input device, and at least one output device, and transmit data and instructions to the storage system, the at least one input device, and the at least one output device.

[0167] Computer programs for implementing 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, so that when the computer program is executed by the processor, the functions / operations specified in the flow chart and / or block diagram are implemented. The computer program may be executed entirely on the machine, partially on the machine, partially on the machine and partially on a remote machine as a stand-alone software package, or entirely on a remote machine or server.

[0168] In the context of the present invention, a computer-readable storage medium may be a tangible medium that may contain or store a computer program for use by or in conjunction with an instruction execution system, device, or equipment. A computer-readable storage medium may include, but is not limited to, electronic, magnetic, optical, electromagnetic, infrared, or semiconductor systems, devices, or equipment, or any suitable combination of the foregoing. Alternatively, a computer-readable storage medium may be a machine-readable signal medium. A more specific example of a machine-readable storage medium may include an electrical connection based on one or more lines, 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 foregoing.

[0169] To provide interaction with a user, the systems and techniques described herein may 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 a pointing device (e.g., a mouse or trackball) through which the user can provide input to the electronic device. Other types of devices may also be used to provide interaction with the user; for example, the feedback provided to the user may be any form of sensory feedback (e.g., visual feedback, auditory feedback, or tactile feedback); and input from the user may be received in any form (including acoustic input, voice input, or tactile input).

[0170] The systems and techniques described herein may be implemented in a computing system that includes backend components (e.g., as a data server), or a computing system that includes middleware components (e.g., an application server), or a computing system that includes frontend components (e.g., a user computer with a graphical user interface or a web browser through which a user can interact with implementations of the systems and techniques described herein), or a computing system that includes any combination of such backend components, middleware components, or frontend components. The components of the system may be interconnected by any form or medium of digital data communication (e.g., a communication network). Examples of communication networks include: a local area network (LAN), a wide area network (WAN), a blockchain network, and the Internet.

[0171] A computing system may include a client and a server. The client and the server are generally remote from each other and usually interact through a communication network. The client and server relationship is generated by computer programs running on the corresponding computers and having a client-server relationship with each other. The server may be a cloud server, also known as a cloud computing server or cloud host, which is a host product in the cloud computing service system to solve the defects of difficult management and weak business scalability in traditional physical hosts and VPS services.

[0172] It should be understood that the various forms of processes shown above can be used to reorder, add or delete steps. For example, the steps described in the present invention can be executed in parallel, sequentially or in different orders, as long as the desired results of the technical solution of the present invention can be achieved, and this document does not limit this.

[0173] 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 can be made according to design requirements and other factors. Any modification, equivalent substitution and improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for configuring a stress testing environment, characterized in that: include: Obtaining the registration subscription information and stress test scaling ratio of the production environment, and determining the server mapping relationship between the production environment and the stress test environment according to the scaling ratio; Deploy a registry center cluster of the same size in the stress testing environment based on the size of the registry center cluster in the production environment. According to the registration subscription information, determine the addresses of each service provider and each service consumer in the stress testing environment, and establish a corresponding relationship between each service provider and each service consumer in the stress testing environment; 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 start each service provider and each service consumer in the stress testing environment to register and subscribe to complete the configuration of the stress testing environment.

2. The method according to claim 1, characterized in that Obtaining a stress test scaling ratio, and determining a server mapping relationship between a production environment and a stress test environment according to the scaling ratio, including: Determine the stress test scaling ratio based on the number of production servers in the production environment and the number of test servers in the stress test environment; According to the scaling ratio, a mapping relationship is established between the plurality of first servers in the production environment and the second servers in the stress testing environment; A plurality of nodes are created in the second server, and a one-to-one mapping relationship is established between the nodes and the first server.

3. The method according to claim 2, characterized in that According to the registration subscription information, the addresses of each service provider and each service consumer in the stress testing environment are determined, and a corresponding relationship between each service provider and each service consumer in the stress testing environment is established, including: Replaying the registration subscription information in the stress testing environment to form a data basis for the stress testing environment, and determining the first server address of each service provider and each service consumer in the production environment according to the registration subscription information; Determine the node addresses of each service provider and each service consumer in the stress testing environment according to the mapping relationship between each node in the stress testing environment and each production server in the production environment and the first server address; According to the correspondence between each service provider and each service consumer in the production environment, a one-to-one correspondence between each service provider and each service consumer in the stress testing environment is established.

4. The method according to claim 1, characterized in that: Obtaining a stress test scaling ratio, and determining a server mapping relationship between a production environment and a stress test environment according to the scaling ratio, including: When performing full capacity expansion stress testing, determine the stress testing scaling ratio based on the number of production servers in the production environment after capacity expansion and the number of test servers in the stress testing environment. According to the scaling ratio, a mapping relationship is established between the first server in the production environment and the plurality of second servers in the stress testing environment.

5. The method according to claim 4, characterized in that According to the registration subscription information, the addresses of each service provider and each service consumer in the stress testing environment are determined, and a corresponding relationship between each service provider and each service consumer in the stress testing environment is established, including: Replaying the registration subscription information in the stress testing environment to form a data basis for the stress testing environment, and determining the first server address of each service provider and each service consumer in the production environment according to the registration subscription information; When performing full capacity expansion stress testing, determining the second server addresses of each service provider and each service consumer in the stress testing environment according to the mapping relationship between each test server in the stress testing environment and each production server in the production environment and the first server address; According to the correspondence between each service provider and each service consumer in the production environment, a one-to-one correspondence between each service provider and each service consumer in the stress testing environment is established.

6. The method according to claim 1, characterized in that Determine the server mapping relationship between the production environment and the stress 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 subscription information; According to 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 according to the link expansion parameter; According to the expansion scale of each production server in the target link and the target service, each target server in the expanded target link is determined, and a mapping relationship between each target server and each second server in the stress testing environment is established.

7. A configuration device for a stress testing environment, characterized in that: include: A server mapping module is used to obtain the registration subscription information and stress test scaling ratio of the production environment, and determine the server mapping relationship between the production environment and the stress test environment according to 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. A service correspondence establishment module, used to determine the addresses of each service provider and each service consumer in the stress testing environment according to the registration subscription information, and establish a 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 registration center in the stress testing environment, and start each service provider and each service consumer in the stress testing environment to register and subscribe to complete the configuration of the stress testing environment.

8. An electronic device, characterized in that: The electronic device comprises: 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, and the computer program is executed by the at least one processor so that the at least one processor can execute the method for configuring the stress testing environment according to any one of claims 1 to 6.

9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a processor to implement the method for configuring a stress testing environment according to any one of claims 1 to 6 when executed.

10. A computer program product, characterized in that The computer program product comprises a computer program, and when the computer program is executed by a processor, the computer program implements the method for configuring a stress testing environment according to any one of claims 1 to 6.

Citation Information

Patent Citations

  • Pressure measuring method and system

    CN115037655A

  • Computer service pressure test system and method

    CN116627799A

  • Comprehensive measurement and control communication digitization unit adaptive to distribution automation system

    CN118826296A

  • Distributed testing service

    US10498625B1

  • Testing functionality of an internet of things environment

    US20200092192A1