Method and apparatus for determining requirement of container resource, server and storage medium
By simulating business calls and stress tests on container resources, a relational model is built, which solves the problems of insufficient accuracy and adaptability of container resource calculation in existing technologies, and achieves efficient resource allocation and quantity determination.
Patent Information
- Application Number
- CN202010724633.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2020-07-24
- Publication Date
- 2025-12-12
- Estimated Expiration
- 2040-07-24
AI Technical Summary
Existing container resource calculation methods rely on human assessment or existing system resource models, resulting in low accuracy, insufficient adaptability and coverage, making it difficult to meet the resource requirements of complex systems.
By receiving system requirement information, we deploy container resources with various configurations for stress testing, build a relational model, and calculate the optimal relational model to determine the optimal configuration and quantity of container resources.
It improves the accuracy and coverage of container resource calculation, reduces reliance on human experience, is applicable to various system architectures, and achieves a high degree of matching between resource information and actual needs.
Smart Images

Figure CN113971115B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of cloud computing, and in particular to a container resource demand determination method and device, a server and a storage medium. BACKGROUND
[0002] With the development and wide application of Docker container technology, the container resources of a bearing system are very important. The number of container resources provided determines the non-functional properties of the system, such as performance, reliability, and security. How to quickly and reasonably calculate the required container resources of the system is a major problem faced by all major systems.
[0003] The existing common technical solutions mainly include the following two kinds:
[0004] Solution one: brain transformation evaluation method: based on traditional human experience, the resource calculation is transformed by the summary method of artificial experience, which mainly depends on the historical experience, technical ability and summary ability of personnel.
[0005] Solution two: reference to the resource mode of existing systems: the existing system refers to a system that has been stable and normally operated for a period of time in the IT industry, and the system architecture and business type are similar. Based on the resource reference data provided by the similar system, a resource demand calculation method is generated.
[0006] However, the inventors found in the implementation of the embodiments of the present application that the existing technical solutions at least have the following problems: first, the brain transformation evaluation method is highly dependent on personnel ability. At the same time, the calculation method transformed by the brain is relatively simple and has no reasonable scientific basis; and as the system becomes more complex and large, the calculation accuracy of the required resources is low from the effect of the calculation method, and system bottlenecks and incorrect evaluation are prone to occur. Second, the resource mode of the existing system requires a high degree of similarity between systems, and other resource types beyond the existing resource category are blind spots; and in actual application, these blind spots are often the core resource points of the system; and from the coverage, the system for evaluation by the resource mode of the existing system is less.
[0007] In summary, the existing technical solutions have serious shortcomings, and from the aspects of accuracy, adaptability, and coverage, they cannot meet the resource calculation requirements of current system maintenance. SUMMARY
[0008] In view of the above problems, the embodiments of the present application are proposed to provide a container resource demand determination method, device, server and storage medium which overcome the above problems or at least partially solve the above problems.
[0009] According to an aspect of an embodiment of the present application, a method for determining requirements of container resources is provided, comprising:
[0010] receiving system requirement information input by a user, wherein the system requirement information comprises environment configuration information and container performance index information;
[0011] deploying container resources of multiple configurations according to the environment configuration information; using the container resources of various configurations to carry system operation and simulate business calls for stress testing, and collecting test result data;
[0012] constructing multiple relationship models corresponding to stress testing of the multiple configurations, wherein each relationship model comprises configuration information of container resources, stress testing conditions and test result data;
[0013] calculating an optimal relationship model according to the container performance index information and the multiple relationship models, and converting the optimal relationship model into resource information.
[0014] According to another aspect of an embodiment of the present application, a device for determining requirements of container resources is provided, comprising:
[0015] a user terminal module adapted to receive system requirement information input by a user, wherein the system requirement information comprises environment configuration information and container performance index information;
[0016] a stress testing module adapted to deploy container resources of multiple configurations according to the environment configuration information; use the container resources of various configurations to carry system operation and simulate business calls for stress testing, and collect test result data;
[0017] a resource calculation module adapted to construct multiple relationship models corresponding to stress testing of the multiple configurations, wherein each relationship model comprises configuration information of container resources, stress testing conditions and test result data; calculate an optimal relationship model according to the container performance index information and the multiple relationship models, and convert the optimal relationship model into resource information.
[0018] According to still another aspect of an embodiment of the present application, a server is provided, comprising a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete communication with each other through the communication bus;
[0019] the memory is used to store at least one executable instruction, and the executable instruction causes the processor to perform operations corresponding to the above method for determining requirements of container resources.
[0020] According to still another aspect of the embodiments of the present application, a computer storage medium is provided, in which at least one executable instruction is stored, and the executable instruction causes a processor to perform operations corresponding to the method for determining requirements of container resources as described above.
[0021] According to the method, device, server and storage medium for determining requirements of container resources, system requirement information input by a user is received, and a plurality of configured container resources are deployed according to environment configuration information in the system requirement information, then stress testing is performed, and test result data is collected; and for a plurality of tests, a relationship model composed of configuration information of the container resources, stress testing conditions and the test result data is established respectively, a plurality of relationship models are obtained, an optimal relationship model is selected according to container performance indexes in the system requirement information and the plurality of relationship models, and then conversion is performed to obtain optimal configuration information of the container resources and the most suitable number of containers. As can be seen, according to the present application, business calling is simulated on various configured container resources, and stress testing is performed, then resource screening and conversion are performed as needed, the resource information highly matched with actual requirements of any system can be determined, compared with the prior art of brain evaluation or reference to resource modes of existing systems, the accuracy, coverage and effectiveness of resource calculation are greatly improved.
[0022] The above description is only a summary of the technical solutions of the embodiments of the present application, in order to more clearly understand the technical means of the embodiments of the present application, the embodiments of the present application can be implemented according to the content of the specification, and in order to make the above and other purposes, features and advantages of the embodiments of the present application more obvious and easy to understand, the following specific embodiments of the embodiments of the present application are described. BRIEF DESCRIPTION OF DRAWINGS
[0023] Various other advantages and benefits will become apparent to those of ordinary skill in the art, upon reading the following detailed description of the preferred embodiments. The accompanying drawings are intended to depict only preferred embodiments of the application, and therefore should not be considered to limit the scope of the application in any way. Similarly, like reference numerals have been used in the drawings to depict like parts of the application. In the drawings:
[0024] Figure 1 A flow chart of the method for determining requirements of container resources provided by the embodiments of the present application is shown;
[0025] Figure 2 A flow chart of the method for determining requirements of container resources provided by another embodiment of the present application is shown;
[0026] Figure 3 A schematic diagram of key environment configuration information input by a user in a specific embodiment is shown;
[0027] Figure 4A flowchart of a simulation pressure measurement process in an optional embodiment is shown;
[0028] Figure 5 A schematic diagram of data contained in a relationship model in a specific embodiment is shown;
[0029] Figure 6 A structural schematic diagram of a container resource demand determination apparatus provided by an embodiment of the present application is shown;
[0030] Figure 7 A structural schematic diagram of a server provided by an embodiment of the present application is shown. DETAILED DESCRIPTION
[0031] Exemplary embodiments of the present application will be described in detail with reference to the drawings. Although exemplary embodiments of the present application are shown in the drawings, it should be understood that the present application can be implemented in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided so that this application will be thorough and complete, and will fully convey the scope of the application to those skilled in the art.
[0032] Figure 1 A flowchart of a container resource demand determination method provided by an embodiment of the present application is shown. The method is used to configure and determine the number of container resources for a target system to run on. As shown in the flowchart, Figure 1 the method includes the following steps:
[0033] Step S110: receiving system demand information input by a user; wherein the system demand information includes environment configuration information and container performance index information.
[0034] The system demand information refers to the demand information of a target system that needs to be carried and run by a container resource. The target system (same as the system below) can be any system that needs to be tested or put online.
[0035] Specifically, through user operation of a terminal, the user can input system demand information necessary for calculating the required container resources. The system demand information at least needs to include environment configuration information so as to subsequently configure container resources of different specifications, and container performance index information, which is limit information on the number of concurrent connections and response results of business calls that a single container can carry, so as to subsequently calculate an optimal relationship model. For example, if the response time in the container performance index is 5 ms, it means that the response time of a business call should be less than or equal to 5 ms when the container carries and runs the system. In addition, the system demand information also includes information necessary for simulating system running, such as code packages and the like.
[0036] Step S120: deploying the multiple configured container resources according to the environment configuration information; using the various configured container resources to carry system running and simulate business calls for stress testing, and collecting test result data.
[0037] The environment configuration information can reflect the hardware and / or software configuration required for system running, for example, the required storage size.
[0038] Specifically, multiple container configurations are set based on the environment configuration information, for example, multiple memory configurations of the container are set to 1G, 2G, 4G, etc. Then, the various configured container resources are used to carry system running, and a stress testing tool is used to simulate business calls and collect test result data. In the process of simulating business calls, for any configured container resource, stress testing is completed by continuously adjusting test conditions, and test result data under different test conditions is collected.
[0039] Step S130: constructing multiple relationship models of stress testing corresponding to multiple configurations, wherein each relationship model includes configuration information of the container resource, stress testing conditions, and test result data.
[0040] The relationship model is a state or content at a certain moment or under a certain condition, which is represented by a single result type and a relationship. The relationship model is static and stable, while the relationship is dynamic and changes over time or conditions.
[0041] In this step, a relationship model is established between the configuration information of the container resource and the stress testing conditions and the corresponding test result data. Then, multiple relationship models can be obtained through multiple tests.
[0042] For example, the configuration information of a certain test is a container resource with 2G memory, the test condition is a concurrency number of 500, and the test result data is a response time of 6ms. Then, a relationship model can be constructed as (configuration: 2G memory; concurrency number: 500; response time: 6ms).
[0043] Step S140: calculating an optimal relationship model according to the container performance index information and the multiple relationship models, and converting the optimal relationship model into resource information.
[0044] In practice, the container resources allocated to the system should be both "necessary" and "essential". In order to ensure that the resource allocation is "necessary", the container performance index information needs to be considered to ensure the normal running of the system. At the same time, in order to ensure that the resource allocation is "essential", additional resources should be avoided as much as possible, where the additional resources have two types, one is idle resources, and the other is wasted resources.
[0045] Based on the above two aspects of "necessity" and "necessity", the relationship model that can use the lowest container resource to meet the container performance index information is selected from multiple relationship models as the optimal relationship model.
[0046] After obtaining the optimal relationship model, the optimal configuration information of the container resource is obtained, which is equivalent to determining the specification of the container resource; and the stress test condition in the optimal relationship model reflects the pressure resistance of the single container resource. The number of required container resources is calculated by using the pressure resistance and the information reflecting the overall pressure resistance in the system requirement information. Thus, the resource information including the optimal configuration information of the container resource and the number of container resources is obtained.
[0047] For example, the maximum concurrency that a single container resource can withstand is 500, and the required concurrency per second of the business is 1000, so the number of required container resources is 1000 / 500 = 2.
[0048] According to the container resource requirement determination method provided in the embodiment, the system requirement information input by the user is received, and the environment configuration information in the system requirement information is used to deploy multiple configured container resources, and then stress testing is performed, and test result data is collected; and for multiple tests, a relationship model composed of configuration information of the container resource, stress test condition and test result data is established respectively, multiple relationship models are obtained, an optimal relationship model is selected according to the container performance index in the system requirement information and the multiple relationship models, and then conversion is performed to obtain the optimal configuration information of the container resource and the most suitable number of containers. As can be seen, the embodiment scheme simulates business calls on various configured container resources and performs stress testing, and then performs resource screening and conversion as needed, so that the resource information highly matched with the actual demand of any system can be determined. Compared with the existing brain evaluation or the technical scheme of referring to the resource mode of the existing system, the accuracy, coverage and effectiveness of resource calculation are greatly improved.
[0049] Figure 2 A flowchart of a container resource requirement determination method provided by another embodiment of the application is shown. As shown in Figure 2 The method includes the following steps:
[0050] Step S210: receiving system requirement information input by a user; wherein the system requirement information includes environment configuration information and container performance index information.
[0051] The user inputs system requirement information on a foreground interface of the user operation terminal, including but not limited to at least one of the following: system name, importance level, middleware version, traffic volume, service message, code package, and environment configuration. These system requirement information will run through the entire life cycle of resource requirement determination, and the user requirement information is tagged through stream processing and saved in a corresponding database table according to the tagged Type, and the code package is saved on an FTP (File Transfer Protocol) server.
[0052] Step S220: deploying container resources of multiple groups of CPU specifications and memory specifications according to the environment configuration information; using the container resources of each group of CPU specifications and memory specifications to carry system running and simulate service calling for stress testing, and collecting test result data.
[0053] Figure 3 A schematic diagram of key environment configuration information input by a user in an embodiment is shown. As shown in Figure 3 The key environment configuration information includes three types of information: system information, container specification, and version information, wherein the container specification includes CPU specification and memory specification. For example, the container specification is 1 CPU and 2G memory. It should be noted that the container specification here is only the ideal specification estimated by the user, and one of the purposes of the embodiment of the present application is to determine the container specification that can actually meet the container performance index information on this basis.
[0054] In the embodiment, the configuration information of the container resource includes CPU specification and memory specification. By adjusting the container specification in the environment configuration information, multiple groups of CPU specifications and memory specifications are obtained. For example, the container specification in the environment configuration information is 1 CPU and 2G memory, and multiple configurations shown in Table 1 can be set as follows:
[0055] CPU specifications (number) Memory specifications (G) Configuration 1 1 1.5 Configuration 2 1 2 Configuration 3 1 2.5 Configuration 4 2 1.5 Configuration 5 2 2 Configuration 6 2 2.5
[0056] As shown in Table 1 above, by adjusting the CPU number and memory size up and down respectively, multiple configurations that differ from the container specification in the environment configuration information within a certain range can be obtained.
[0057] After setting multiple configurations, i.e., multiple groups of CPU specifications and memory specifications, container resources of these specifications are deployed, wherein one container resource of each specification is set. Then, for each group of CPU specifications and memory specifications, the container resource is used to carry system running and perform simulation stress testing, and test result data is collected. It should be noted that the specific technical implementation of simulation stress testing is not limited in the embodiment of the present application, and a person skilled in the art can flexibly select a corresponding implementation mode according to actual requirements. The specific process of simulation stress testing is described below with an optional technical implementation:
[0058] Figure 4 A simplified flowchart illustrating the simulated load testing process in one optional implementation is shown. In this optional implementation, the system requirements information also includes the system's code packages and business messages. For example... Figure 4 As shown, after deploying multiple sets of container resources with different CPU and memory specifications based on the environment configuration information, multiple application-independent image files are generated based on these specifications for comparative testing. Then, during simulated load testing, these image files, the load testing tool (as shown in the diagram), and the code package are merged to generate a container image for container deployment and operation. The test tool is configured via a Dockerfile to collect test data, and deployment can be dynamically adjusted if the application system or configuration file is modified. The container resources, containing the application, are run based on this image and provide application services. Test cases are generated based on business messages to stress test the container resources. Test results are collected using the load testing tool, noise reduction is applied to the data, and a baseline value for each test result is obtained. The data is then stored for subsequent integration and analysis. Furthermore, the test cases are further tagged, such as with system name, time slice, and business type, and then interacted with the database to persist the data for reuse.
[0059] Furthermore, during the stress test, the stress test conditions are continuously adjusted for any set of container resources with different CPU and memory specifications to complete multiple tests. For example, the concurrency is continuously increased to complete the test sequentially until it exceeds the capacity of the currently configured container resources, at which point the stress test on the currently configured container resources is stopped.
[0060] Step S230: Construct multiple relational models for stress tests corresponding to various configurations, wherein each relational model includes container resource configuration information, stress test conditions, and test result data.
[0061] A combination of a configuration and a stress test condition, along with the corresponding test result data, can constitute a relational model.
[0062] A relational model represents a state or content at a specific moment or under specific conditions, expressed by a single result type and relation. Relational models are static and stable, while relations are dynamic and change over time or under specific conditions. A relational model is established using container configurations, stress test conditions, and test result data, and this model is persistently saved for easy integration and analysis later.
[0063] Figure 5 A schematic diagram of the data contained in the relational model is shown in a specific embodiment. For example...Figure 5 As shown, the relationship model is composed of three parts, container configuration, condition and performance, wherein the container configuration includes CPU specification and memory specification, the condition refers to the stress test condition, which includes the concurrency condition and / or the test time condition, and the performance refers to the test result, and the test result data includes the response time and / or the response success rate.
[0064] Step S240: calculating the optimal relationship model according to the container performance index information and the plurality of relationship models.
[0065] Specifically, in order to ensure the "necessity" and "essentiality" of resource allocation, the calculation formula of the optimal relationship model is set as follows: In the formula, M is the optimal relationship model, Yx represents the container performance index information, Mx is the information corresponding to the container performance index information in the stress test condition and the test result data, and Md represents the configuration information of the container resource. The container performance index information refers to the limit information of the concurrency number and the response result of the business call that a single container can bear, and the meaning of Mx>Yx includes that the concurrency condition in the stress test condition is greater than or equal to the concurrency number in the container performance index information, the response time in the test result data is less than or equal to the response time in the container performance index information, and the response success rate in the test result data is higher than or equal to the response success rate in the container performance index information. Moreover, the higher the configuration information is, the more resources are required, and vice versa. Accordingly, Min(Md) represents the lowest configuration information in all relationship models satisfying Mx>Yx, i.e., the CPU and memory with the lowest configuration.
[0066] It should be noted that in practice, there may be multiple groups of relationship models satisfying the above calculation formula of the optimal relationship model, and the following is usually the case: in multiple stress tests on the same lower configuration container resource, the concurrency condition, the response time and the response success rate of at least two stress tests all satisfy Mx>Yx. For the above case, one relationship model with the highest concurrency number, the shortest response time and / or the highest response success rate is selected from the multiple groups of relationship models satisfying the above optimal relationship model formula as the optimal relationship model, so as to ensure the uniqueness of the optimal relationship model and facilitate the subsequent calculation of the number of container resources.
[0067] Step S250: calculating the concurrency number of the business per second according to the business call per second, the average response time and the importance information of the system; and calculating the number of required container resources according to the ratio of the concurrency number of the business per second to the concurrency condition in the optimal relationship model.
[0068] The system requirement information further includes Queries-per-second (QPS), average response time and importance information of the system, which are different from the container performance index information in the object, and the three are requirements for the whole system, while the container performance index information is a requirement for a single container.
[0069] The optimal relationship model obtained in the foregoing is only related information of a single container, and when determining the requirement of the container resource, the number of the container resource needs to be further determined. Specifically, the formula for calculating the concurrent number of the service per second is as follows: PV = QPS * k / RTT * F, wherein PV represents the concurrent number of the service per second, QPS represents the Queries-per-second, k represents the proportion of the peak time of the service call, which can be set as 80% in general, RTT represents the average response time, and F represents the redundancy reservation of the future service amount development of the system, which refers to the increase amplitude of the service amount in the service life of the system. For example, if the initial service amount is 1000 and the service amount will increase by 50% in the 5 years of the system use, F can be set as 150%.
[0070] Further, the PV value, that is, the concurrent number of the service per second, calculated by using the formula above reflects the concurrent number required by the system. The concurrent number in the test condition of the optimal relationship model refers to the maximum concurrent number that can be borne by a single container, and thus the number of the required container resource can be obtained by calculating the ratio of PV to the concurrent number in the optimal relationship model.
[0071] According to the container resource requirement determination method provided in the embodiment, the actual business is simulated to perform the stress test, the performance judgment of the application container is more accurate, the whole process is highly automated, the resource calculation efficiency is significantly improved, the dependence on human experience is greatly reduced, the energy input of the professional personnel is reduced, a large amount of manpower is saved, the method can be universally applied to various system frameworks, and is no longer limited to special system architectures, so that the application range is wider.
[0072] Figure 6 The structure schematic diagram of the container resource requirement determination apparatus provided in the embodiment of the application is shown. As shown in the figure, Figure 6 The apparatus comprises:
[0073] The user terminal module 610 is adapted to receive the system requirement information input by the user, wherein the system requirement information includes environment configuration information and container performance index information.
[0074] The stress test module 620 is adapted to deploy container resources with various configurations according to the environment configuration information, bear the system operation by using the container resources with various configurations and simulate the service call to perform the stress test, and collect the test result data.
[0075] The resource calculation module 630 is adapted to construct a plurality of relationship models corresponding to pressure tests of a plurality of configurations, wherein each relationship model comprises configuration information of container resources, pressure test conditions and test result data; calculate an optimal relationship model according to the container performance index information and the plurality of relationship models, and convert the optimal relationship model into resource information.
[0076] In an optional manner, the pressure test module further comprises an application deployment unit adapted to deploy container resources of a plurality of groups of CPU specifications and memory specifications according to the environment configuration information.
[0077] The pressure test unit is adapted to carry system running and simulate business calls by using container resources of each group of CPU specifications and memory specifications to perform pressure tests.
[0078] The result collection unit is adapted to stimulate test result data.
[0079] In an optional manner, the system requirement information further comprises a code package and a business message of the system.
[0080] The application deployment module is further adapted to generate a plurality of application-independent image files according to the plurality of groups of CPU specifications and memory specifications; fuse the image files, a pressure test tool and the code package to generate a container image; and run container resources based on the container image.
[0081] The pressure test module is further adapted to generate test cases according to the business message for pressure testing of the container resources.
[0082] In an optional manner, the pressure test conditions comprise a concurrency condition and / or a test time condition; and the test result data comprises a response time and / or a response success rate.
[0083] In an optional manner, the resource calculation module further comprises a relationship model unit adapted to calculate an optimal relationship model, wherein a calculation formula of the optimal relationship model is: In the formula, M is the optimal relationship model, Yx represents the container performance index information, Mx is information corresponding to the container performance index information in the pressure test conditions and the test result data, and Md represents the configuration information of the container resources.
[0084] In an optional manner, the system requirement information further comprises a business call quantity per second, an average response time and important degree information of the system.
[0085] The resource calculation module further includes: a resource conversion unit, adapted to calculate the number of concurrent services per second based on the service call volume per second, average response time, and system importance information;
[0086] The required number of container resources is calculated based on the ratio of the number of concurrent services per second to the number of concurrent conditions in the optimal relationship model.
[0087] In an alternative embodiment, the resource conversion unit is further adapted to: calculate the number of concurrent services per second, wherein the formula for calculating the number of concurrent services per second is as follows: PV = QPS * k / RTT * F.
[0088] In the formula, PV represents the number of concurrent services per second, QPS represents the number of service calls per second, k represents the proportion of peak service call periods, RTT represents the average response time, and F represents the redundancy reservation for future service volume development of the system.
[0089] This invention provides a non-volatile computer storage medium storing at least one executable instruction that can execute the container resource requirement determination method in any of the above method embodiments.
[0090] Figure 7 The diagram shows a structural schematic of a server provided in an embodiment of the present invention. The specific implementation of the server is not limited by the specific embodiments of the present invention.
[0091] like Figure 7 As shown, the server may include: a processor 702, a communications interface 704, a memory 706, and a communications bus 708.
[0092] The processor 702, communication interface 704, and memory 706 communicate with each other via communication bus 708. Communication interface 704 is used to communicate with other network elements such as clients or other servers. The processor 702 executes program 710, specifically performing the relevant steps in the above-described embodiment of the method for determining container resource requirements for servers.
[0093] Specifically, program 710 may include program code that includes computer operation instructions.
[0094] The processor 702 can be a central processing unit (CPU), or an application specific integrated circuit (ASIC), or one or more integrated circuits configured to perform the operations of embodiments of the application. The server can include one or more processors of the same type, such as one or more CPUs; or different types of processors, such as one or more CPUs and one or more ASICs.
[0095] The memory 706 stores the program 710. The memory 706 can include a high-speed RAM memory, and can also include a non-volatile memory, such as at least one disk memory.
[0096] The program 710 can specifically cause the processor 702 to perform the following operations:
[0097] Receive user input system requirement information; wherein the system requirement information includes environment configuration information and container performance index information;
[0098] Deploy a plurality of configured container resources according to the environment configuration information; use the various configured container resources to carry the system to run and simulate business calls to perform stress testing, and collect test result data;
[0099] Build a plurality of relationship models corresponding to the stress testing of the plurality of configurations, wherein each relationship model includes configuration information of the container resource, stress testing conditions, and test result data;
[0100] According to the container performance index information and the plurality of relationship models, calculate an optimal relationship model, and convert the optimal relationship model into resource information.
[0101] In an optional manner, the program 710 further causes the processor 702 to perform the following operations:
[0102] Deploy a plurality of groups of CPU specifications and memory specifications of the container resources according to the environment configuration information;
[0103] Use the container resources of each group of CPU specifications and memory specifications to carry the system to run and simulate business calls to perform stress testing, and collect test result data.
[0104] In an optional manner, the system requirement information further includes: a code package of the system and a business message;
[0105] The program 710 further causes the processor 702 to perform the following operations:
[0106] generating a plurality of application-independent image files according to the plurality of groups of CPU specifications and memory specifications;
[0107] fusing the image files, the stress testing tool and the code package to generate a container image, and running a container resource based on the container image;
[0108] generating test cases according to the service packets for stress testing of the container resource, and collecting test result data.
[0109] In an optional manner, the stress testing conditions include a concurrency condition and / or a test time condition, and the test result data includes a response duration and / or a response success rate.
[0110] In an optional manner, the program 710 further causes the processor 702 to perform the following operation:
[0111] The calculation formula of the optimal relationship model is as follows: In the formula, M is the optimal relationship model, Yx represents the container performance index information, Mx is information corresponding to the container performance index information in the stress testing conditions and the test result data, and Md represents the configuration information of the container resource.
[0112] In an optional manner, the system requirement information further includes a service call quantity per second, an average response time and system importance information;
[0113] The program 710 further causes the processor 702 to perform the following operation: calculating the concurrency of services per second according to the service call quantity per second, the average response time and the system importance information;
[0114] According to a ratio of the concurrency of services per second to the concurrency condition in the optimal relationship model, the quantity of required container resources is calculated.
[0115] In an optional manner, the program 710 further causes the processor 702 to perform the following operation:
[0116] The calculation formula of the concurrency of services per second is as follows: PV = QPS * k / RTT * F,
[0117] In the formula, PV represents the concurrency of services per second, QPS represents the service call quantity per second, k represents a proportion of a service call peak time period, RTT represents the average response time, and F represents a future service volume development redundancy reservation of the system.
[0118] The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems can be used with programs in accordance with the teachings herein, or it can prove convenient to construct more specialized apparatus to perform the required method steps. The required structure for a variety of these systems will be apparent from the description above. In addition, the present embodiments are not described with reference to any particular programming language. It will be appreciated that a variety of programming languages can be used to implement the teachings of the embodiments as described herein, and any references below to specific languages are provided for disclosure of enablement only.
[0119] In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the application can be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been described in detail in order to avoid obscuring the understanding of this description.
[0120] Similarly, it is to be understood that the mechanical details of the application can be practiced without such specific detail. In other instances, well-known methods, structures and techniques have not been described in detail in order to avoid obscuring the understanding of this description.
[0121] It will be appreciated by those skilled in the art that the modules in the apparatus of the embodiments can be adapted and placed in one or more devices other than the device of the embodiments. The modules or units or components in the embodiments can be combined into one module or unit or component and further can be divided into multiple sub-modules or sub-units or sub-components. Except that at least some of such features and / or processes or units are mutually exclusive, any combination of all the features disclosed in the specification (including the accompanying claims, abstract and drawings), and all the processes or units of any of the methods or apparatuses disclosed so far can be adopted. Unless explicitly stated otherwise, each feature disclosed in the specification (including the accompanying claims, abstract and drawings) can be replaced by an alternative feature providing the same, equivalent or similar functionality.
[0122] Furthermore, those skilled in the art will recognize that, while certain embodiments described herein include certain features that are not included in other embodiments, combinations of features of the different embodiments are meant to be within the scope of the application and form different embodiments. For example, in the claims below, any of the claimed embodiments can be used in any combination.
[0123] Various component embodiments of the application can be implemented in hardware, or as software modules running in one or more processors, or in combinations thereof. Skilled persons will appreciate that a microprocessor or digital signal processor (DSP) can be used in practice to implement some or all of the functionality of some or all of the components according to embodiments of the application. Embodiments of the application can also be implemented as a program of apparatuses or devices (e.g. computer programs and computer program products) for performing part or all of the methods described herein. Such program implementing embodiments of the application can be stored on computer-readable media, or can be in the form of one or more signals. Such signals can be downloaded from an Internet website, or provided on a carrier signal, or in any other form.
[0124] It should be noted that the above-mentioned embodiments illustrate rather than limit the application, and that one skilled in the art will be able to design many alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word 'comprising' does not exclude the presence of elements or steps other than those listed in a claim. The word 'a' or 'an' preceding an element does not exclude the presence of a plurality of such elements. An embodiment of the application can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim, several devices can be listed with a comma. Such listing does not imply that the devices must be co-located. The use of the word 'at least' followed by a list of one or more members does not exclude additional members of the same class or steps. The word 'first','second', 'third', etc. do not imply any order. The terms 'first','second', 'third', etc. are to be interpreted as names. The steps of any of the methods disclosed herein do not have to be performed in the exact order disclosed.
Claims
1. A method for determining requirements of container resources, comprising: receiving system requirement information input by a user, wherein the system requirement information comprises environment configuration information and container performance index information; deploying container resources of multiple configurations according to the environment configuration information; and carrying out system running and simulating business calls to perform stress testing by using the container resources of various configurations, and collecting test result data; constructing multiple relationship models corresponding to stress testing of the multiple configurations, wherein each relationship model comprises configuration information of container resources, stress testing conditions, and test result data; the relationship model is a state or content at a moment or condition, and is represented by a single result type and a relationship; calculating an optimal relationship model according to the container performance index information and the multiple relationship models, and converting the optimal relationship model into resource information; wherein the calculating an optimal relationship model according to the container performance index information and the multiple relationship models further comprises: The calculation formula of the optimal relationship model is: In the formula, M is the optimal relationship model, Yx represents container performance index information, the container performance index information is limit information on the concurrent number that a single container can bear and a response result of a service call, Mx is information corresponding to the container performance index information in the stress test condition and test result data, Md represents configuration information of a container resource, and Min(Md) represents the lowest configuration information in all relationship models satisfying Mx>Yx. The meaning of Mx>Yx includes that the concurrent number condition in the stress test condition is greater than or equal to the concurrent number in the container performance index information, the response time in the test result data is less than or equal to the response time in the container performance index information, and the response success rate in the test result data is higher than or equal to the response success rate in the container performance index.
2. The method of claim 1, wherein, the deploying container resources of multiple configurations according to the environment configuration information further comprises: deploying container resources of multiple groups of CPU specifications and memory specifications according to the environment configuration information; the carrying out system running and simulating business calls to perform stress testing by using the container resources of various configurations specifically comprises: carrying out system running and simulating business calls to perform stress testing by using the container resources of each group of CPU specifications and memory specifications, and collecting test result data.
3. The method of claim 2, wherein, the system requirement information further comprises a code package of the system and a business message; after the deploying container resources of multiple groups of CPU specifications and memory specifications according to the environment configuration information, the method further comprises: generating multiple application-unrelated image files according to the multiple groups of CPU specifications and memory specifications; the carrying out system running and simulating business calls to perform stress testing by using the container resources of each group of CPU specifications and memory specifications further comprises: fusing the image files, a stress testing tool, and the code package to generate a container image; and running container resources based on the container image; generating test cases based on the business message for stress testing of the container resources to collect test result data.
4. The method according to any one of claims 1 to 3, wherein, the stress testing conditions comprise a concurrency condition and / or a test time condition; and the test result data comprises a response time and / or a response success rate.
5. The method of claim 1, wherein, the system requirement information further comprises a quantity of business calls per second, an average response time, and importance information of the system; the method further comprises calculating a concurrency of business calls per second according to the quantity of business calls per second, the average response time, and the importance information of the system; the converting the optimal relationship model into resource information further comprises calculating a quantity of required container resources according to a ratio of the concurrency of business calls per second to a concurrency condition in the optimal relationship model.
6. The method of claim 5, wherein, the calculating a concurrency of business calls per second according to the quantity of business calls per second, the average response time, and the importance information of the system further comprises: The formula for calculating the number of concurrent services per second is as follows: , In the formula, PV represents the number of concurrent services per second, QPS represents the number of service calls per second, k represents the proportion of peak service call time, RTT represents the average response time, and F represents the future development of the system's service volume.
7. A container resource demand determination apparatus, comprising: a user terminal module adapted to receive user input system demand information; wherein the system demand information comprises environment configuration information and container performance index information; a stress test module adapted to deploy a plurality of configured container resources according to the environment configuration information; use the various configured container resources to carry out system operation and simulate service calls to perform stress testing, collect test result data; the relationship model is a state or content at a moment or condition, represented by a single result type, relationship; a resource calculation module adapted to construct a plurality of relationship models corresponding to stress testing of a plurality of configurations, wherein each relationship model comprises configuration information of a container resource, stress testing conditions and test result data; calculate an optimal relationship model according to the container performance index information and the plurality of relationship models, and convert the optimal relationship model into resource information; The calculation formula of the optimal relationship model is: In the formula, M is the optimal relationship model, Yx represents container performance index information, the container performance index information is limit information on the concurrent number that a single container can bear and a response result of a service call, Mx is information corresponding to the container performance index information in the stress test condition and test result data, Md represents configuration information of a container resource, and Min(Md) represents the lowest configuration information in all relationship models satisfying Mx>Yx. The meaning of Mx>Yx includes that the concurrent number condition in the stress test condition is greater than or equal to the concurrent number in the container performance index information, the response time in the test result data is less than or equal to the response time in the container performance index information, and the response success rate in the test result data is higher than or equal to the response success rate in the container performance index.
8. A server comprising: a processor, a memory, a communication interface and a communication bus, the processor, the memory and the communication interface being in communication with each other through the communication bus; the memory is used to store at least one executable instruction, and the executable instruction makes the processor execute the operation corresponding to the container resource demand determination method in any one of claims 1-6.
9. A computer storage medium, the storage medium storing at least one executable instruction, the executable instruction making the processor execute the operation corresponding to the container resource demand determination method in any one of claims 1-6.
Citation Information
Patent Citations
Docker-based software large-scale-testing method
CN108121654A
Service container resource allocation method and system under distributed cloud system-cloud cluster architecture
CN111381936A