Cloud host performance test method and device, electronic equipment and storage medium

By automatically building cloud resource environment and target cloud hosts, performing performance testing and analysis, the problem of low performance testing efficiency and prone to errors in manual testing mode is solved, and a fast and accurate cloud host performance evaluation is achieved.

CN119806974APending Publication Date: 2025-04-11CHINA TELECOM CLOUD TECH CO LTD
View PDF 0 Cites 1 Cited by

Patent Information

Application Number
CN202411773981.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-04
Publication Date
2025-04-11

AI Technical Summary

Technical Problem

In manual testing mode, the cloud host performance testing scenarios are complex, resulting in low testing efficiency and prone to human errors, making it difficult to meet the needs of cloud computing environment.

Method used

By obtaining test parameters of different test dimensions entered by users, we automatically build the cloud resource environment and determine the target cloud host, conduct performance testing, and analyze resource usage and performance testing data to obtain the performance of the cloud host.

Benefits of technology

It realizes automation from test preparation to data acquisition and analysis, improves testing efficiency, reduces human error, and can quickly and accurately evaluate cloud host performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119806974A_ABST
    Figure CN119806974A_ABST
Patent Text Reader

Abstract

The invention relates to the field of cloud computing, and discloses a cloud host performance test method and device, electronic equipment and a storage medium. According to the method, the test parameters of different test dimensions are obtained, so that the problem of undefined parameter setting in manual test is avoided. The cloud resource environment is automatically constructed by using the test parameters, and the target cloud host is determined, so that the tedious steps of manually configuring the environment and selecting the test object are omitted. According to the method, the target cloud host is automatically subjected to the performance test in the cloud resource environment, the performance test data is obtained, and the resource use condition is detected, so that the process of manually operating a test tool and recording data in manual test is replaced, and errors caused by manual operation are reduced. Finally, the performance condition of the cloud host is obtained by analyzing the resource use condition and the performance test data, and the problems that in a manual test mode, the test efficiency is low, personal errors are likely to be generated, and the performance test requirement of the cloud host in the cloud computing environment is difficult to meet are effectively solved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of cloud computing, and in particular to a method, device, electronic equipment and storage medium for testing the performance of a cloud host. Background Art

[0002] With the widespread application of cloud computing technology, cloud hosts have become an important infrastructure for many enterprises and users to deploy applications. The performance of cloud hosts is crucial to ensuring the stable operation of applications. At present, cloud host performance testing mainly relies on manual testing methods. However, the performance of cloud hosts is affected by many factors, including different specifications and architectures of the cloud hosts themselves, as well as the architecture and system load of the physical servers that host the cloud hosts. Due to the high-dimensional characteristics of these influencing factors, the cloud host performance testing scenarios have become extremely complex and numerous, which greatly increases the difficulty of testing.

[0003] In the manual testing mode, facing such complex testing scenarios, the testing efficiency is low and human errors are prone to occur. This makes it very difficult to quickly and accurately evaluate the performance differences between cloud hosts and cloud hosts, and it is difficult to meet the needs of cloud host performance testing in the cloud computing environment. Summary of the invention

[0004] In view of this, an embodiment of the present invention provides a cloud host performance testing method, device, electronic device and storage medium to solve the problem that in manual testing mode, when faced with such a complex testing scenario, the testing efficiency is low and human errors are prone to occur, making it difficult to meet the demand for cloud host performance testing in a cloud computing environment.

[0005] In a first aspect, an embodiment of the present invention provides a method for testing cloud host performance, the method comprising:

[0006] Get the test parameters of different test dimensions input by the user;

[0007] Using the test parameters to build the cloud resource environment required for the test, and determining the target cloud host for the current performance test;

[0008] Performing a performance test on the target cloud host in the cloud resource environment to obtain performance test data of the cloud host, and detecting resource usage of the target server where the target cloud host is located;

[0009] The resource usage and the performance test data are analyzed to obtain the performance of the cloud host.

[0010] Furthermore, the use of the test parameters to construct a cloud resource environment required for the test includes:

[0011] Obtaining the status of each origin server in the test scenario;

[0012] If the state of the original server is normal, configuring the original server according to the test parameters to obtain a candidate server;

[0013] Detect whether the candidate server meets the preset conditions for creating a cloud resource environment;

[0014] If the candidate server meets the preset conditions for creating the cloud resource environment, obtaining the creation configuration information of the cloud host, and using the creation configuration information to create the resource environment and the cloud host in the configured candidate server;

[0015] Check the status information of the created cloud host. If the cloud host has an abnormal situation, delete the abnormal cloud host and recreate it until the cloud resource environment required for the test is obtained.

[0016] Further, configuring the original server according to the test parameters to obtain a candidate server includes:

[0017] Extracting a preset CPU over-provisioning ratio and a preset memory over-provisioning ratio from the test parameters;

[0018] Detecting whether the original server carries a cloud host that does not participate in the performance test;

[0019] If the original server carries a cloud host that does not participate in the performance test, the cloud host that does not participate in the performance test is migrated to another server, and the migrated original server is marked as being in an unloaded state;

[0020] Obtaining a CPU over-provisioning ratio and a memory over-provisioning ratio of an original server in an unloaded state, and respectively modifying the CPU over-provisioning ratio and the memory over-provisioning ratio using the preset CPU over-provisioning ratio and the preset memory over-provisioning ratio to obtain a configured original server;

[0021] Use the configured original server as a candidate server.

[0022] Furthermore, determining the target cloud host for the current performance test includes:

[0023] Get the number of cloud hosts for concurrent stress testing;

[0024] A number of cloud hosts are selected from the candidate cloud hosts as candidate cloud hosts, and a performance test script is uploaded to the candidate cloud hosts, and the candidate cloud hosts configured with the performance test script are used as target cloud hosts to be subjected to performance testing.

[0025] Further, the performing of a performance test on the target cloud host in the cloud resource environment to obtain performance test data of the cloud host and detecting resource usage of a target server where the target cloud host is located includes:

[0026] Sending an instruction to execute a performance test to the target cloud host, so that the target cloud host executes the performance test based on the performance test script, and calling a monitoring process to monitor the CPU usage and memory usage of the server during the performance test of the target cloud host;

[0027] Detecting the test progress of the performance test of the target cloud host according to a preset time period;

[0028] If it is detected that the test progress is in a completed state, the performance test data of the cloud host is obtained, and the resource usage of the target server where the target cloud host is located is detected.

[0029] Further, the analyzing the resource usage and the performance test data to obtain the performance of the cloud host includes:

[0030] extracting key data from the performance test data according to the number of performance executions;

[0031] Obtain the average CPU usage and average memory usage of the server during the performance test;

[0032] The key data, the average CPU usage and the average memory usage are analyzed to obtain the performance of the cloud host.

[0033] Furthermore, after analyzing the resource usage and the performance test data to obtain the performance of the cloud host, the method further includes:

[0034] detecting the number of scenarios of the test scenario;

[0035] If there are multiple test scenarios, read whether to clear the target parameter of resource configuration, and if the target parameter does not exist, do not perform a cleanup operation on the cloud resource environment;

[0036] Or, if the number of scenarios in the test scenario is not multiple, a cleanup operation is performed on the cloud resource environment.

[0037] In a second aspect, an embodiment of the present invention provides a cloud host performance testing device, the device comprising:

[0038] An acquisition module is used to obtain test parameters of different test dimensions input by the user;

[0039] A determination module is used to construct a cloud resource environment required for the test using the test parameters and determine a target cloud host for the current performance test;

[0040] A testing module, used to perform a performance test on the target cloud host in the cloud resource environment, obtain performance test data of the cloud host, and detect resource usage of the target server where the target cloud host is located;

[0041] The analysis module is used to analyze the resource usage and the performance test data to obtain the performance of the cloud host.

[0042] In a third aspect, an embodiment of the present invention provides an electronic device, comprising: a memory and a processor, the memory and the processor being communicatively connected to each other, computer instructions being stored in the memory, and the processor executing the method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.

[0043] In a fourth aspect, an embodiment of the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute the method of the first aspect or any corresponding embodiment thereof.

[0044] This application achieves accurate quantification and input of test requirements by obtaining test parameters of different test dimensions, avoiding the problem of unclear parameter settings in manual testing. The cloud resource environment is automatically constructed and the target cloud host is determined by using test parameters, eliminating the tedious steps of manually configuring the environment and selecting test objects, greatly improving the efficiency of test preparation. Automatically perform performance testing on the target cloud host in the cloud resource environment, obtain performance test data and detect resource usage, which replaces the process of manually operating test tools and recording data in manual testing, reducing errors caused by human operation. Finally, the performance of the cloud host is obtained by analyzing the resource usage and performance test data. The entire process realizes automation from test preparation to data collection and analysis, and can quickly and accurately evaluate the performance of the cloud host, effectively solving the problems of low test efficiency, easy to produce human errors and difficulty in meeting the performance testing requirements of the cloud host in the cloud computing environment under the manual testing mode. BRIEF DESCRIPTION OF THE DRAWINGS

[0045] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.

[0046] Figure 1is a flowchart of a method for testing cloud host performance according to some embodiments of the present invention;

[0047] Figure 2 is a schematic diagram of a parameter configuration process according to some embodiments of the present invention;

[0048] Figure 3 is a schematic diagram of creating a cloud resource environment according to some embodiments of the present invention;

[0049] Figure 4 is a schematic diagram of testing a cloud host according to some embodiments of the present invention;

[0050] Figure 5 is a schematic diagram of clearing cloud resources according to some embodiments of the present invention;

[0051] Figure 6 is a structural block diagram of a cloud host performance testing device according to an embodiment of the present invention;

[0052] Figure 7 It is a schematic diagram of the hardware structure of the electronic device according to an embodiment of the present invention. DETAILED DESCRIPTION

[0053] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution 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 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 those skilled in the art without creative work are within the scope of protection of the present invention.

[0054] According to an embodiment of the present invention, a method, device, electronic device and storage medium for testing the performance of a cloud host are provided. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer system such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.

[0055] In this embodiment, a method for testing the performance of a cloud host is provided. Figure 1 is a flow chart of a method for testing cloud host performance according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:

[0056] Step S101, obtaining test parameters of different test dimensions input by a user.

[0057] In an embodiment of the present application, before the test process is started, it is necessary to obtain test parameters of different test dimensions input by the user. Specifically, first, the flavor parameter of the cloud host specification is obtained. As an array type, the user needs to provide a variety of specification options such as different CPU core numbers and memory sizes; then the image parameter of the cloud host is obtained, which is also in array form, and must clearly include common open source performance testing tools such as unixbench, stream, etc., as well as multiple images of possible user-defined applications or tools; then the zone parameter of the available zone where the cloud host is located is obtained, which is presented in an array to indicate the different available zones where the cloud host can be deployed; then the server-related parameters of the physical server that can create the host are obtained, which is also an array type, covering the relevant information of each physical server that can be used to create the cloud host; there are also the server's cpu over-provisioning ratio cpu_ratio and memory over-provisioning ratio memory_ratio parameters. , both of which are array types, and different over-provisioning ratio values ​​are set by the user; the parameter count for the number of cloud hosts to be created is also an array type, which is used to determine the different numbers of cloud hosts to be created; the parameter threads for the number of cloud hosts to be tested concurrently is also an array type, which specifies the number of cloud hosts to be tested simultaneously; the disk type voulme_size and size volume_size parameters are array-based, reflecting different disk types and corresponding capacity sizes; the performance testing tool tools parameter is also an array type, and common open source performance testing tools or user-defined applications and tools can be selected; the performance test number retries only needs to enter a specific value. If the user believes that the existing parameters are not sufficient to meet specific test requirements, the parameter can be expanded horizontally by directly defining new parameters and specifying their parameter types and default values, so as to comprehensively collect various parameters to generate all test scenarios required for subsequent tests.

[0058] As an example, Figure 2 As shown in the figure, first obtain the user configuration parameter list, which includes server, zone, flavor, image, cpu_ratio, memory_ratio, volume_type, volume_size, count, threads, tools, etc. Then perform Cartesian product operation on these parameter lists to obtain all test scenarios, and finally the process ends.

[0059] Server refers to the physical server or virtual server resources provided by the cloud service provider. It can be a specific host name, IP address, or server identifier, which is used to determine which servers to create and run cloud resources.

[0060] A zone is a physically isolated partition of a cloud service provider's data center within a region. Different availability zones can provide redundancy and fault isolation, ensuring that when a failure occurs in one availability zone, resources in other availability zones can still operate normally.

[0061] Flavors (instance specifications) define the computing, memory, storage, and network capabilities of a cloud host (such as an EC2 instance). Different flavors are suitable for different types of application requirements, from small instances with low power consumption to large instances with high performance.

[0062] An image is a template that contains an operating system and pre-installed software and is used to create a cloud host. It can be an operating system image (such as Ubuntu, CentOS) or a custom image that contains specific applications and configurations.

[0063] cpu_ratio (CPU ratio) refers to the ratio or share of CPU resources allocated to cloud resources. It can be used to control and allocate CPU resources in a multi-tenant environment to ensure that each tenant or application gets the appropriate computing power.

[0064] memory_ratio is similar to cpu_ratio, which represents the proportion or share of memory resources allocated to cloud resources. It is used to control and allocate memory resources in a multi-tenant environment.

[0065] volume_type defines the performance and characteristics of a cloud storage volume. Different storage volume types may include standard storage, high-performance storage, SSD storage, etc., suitable for different application requirements.

[0066] Volume_size refers to the capacity of a cloud storage volume, usually in GB or TB. It determines the amount of data that can be stored on the storage volume.

[0067] Count indicates the number of cloud resources (such as cloud hosts, storage volumes, etc.) to be created. It is used to create and manage resources in batches.

[0068] Threads refers to the number of application threads running on the cloud host, or the number of concurrent threads used in scenarios such as performance testing.

[0069] Tools refer to tools used to manage, monitor, configure, and operate cloud resources. These tools can include command line tools, automation scripts, monitoring software, etc.

[0070] Step S102, using the test parameters to build the cloud resource environment required for the test, and determining the target cloud host for the current performance test.

[0071] In the embodiment of the present application, the cloud resource environment required for the test is constructed using the test parameters, including the following steps A1-A5:

[0072] Step A1, obtaining the status of each original server in the test scenario.

[0073] Specifically, first, from the test scenario determined by the parameter processing module, sort out the relevant information of each original server involved, send status query requests to these original servers through the corresponding system interface or management tool, collect various operating indicators and basic status information of the server, such as the server's hardware health status, network connection status, occupied resources, etc., so as to comprehensively obtain the current status of each original server and provide a basis for subsequent judgment whether further operations can be performed.

[0074] Step A2: If the status of the original server is normal, the original server is configured according to the test parameters to obtain a candidate server.

[0075] Specifically, the original server is configured according to the test parameters to obtain a candidate server, including: extracting a preset CPU over-provisioning ratio and a preset memory over-provisioning ratio from the test parameters. Detecting whether the original server carries a cloud host that did not participate in the performance test. If the original server carries a cloud host that did not participate in the performance test, migrate the cloud host that did not participate in the performance test to other servers, and mark the migrated original server as an idle state. Obtain the CPU over-provisioning ratio and memory over-provisioning ratio of the original server in the idle state, and modify the CPU over-provisioning ratio and the memory over-provisioning ratio using the preset CPU over-provisioning ratio and the preset memory over-provisioning ratio respectively to obtain the configured original server. Use the configured original server as a candidate server.

[0076] First, based on the set test parameters, the preset CPU over-provisioning ratio (cpu_ratio) and the preset memory over-provisioning ratio (memory_ratio) are accurately extracted. These preset values ​​are determined in advance according to the test plan or specific requirements, and are used to standardize the configuration of server resource over-provisioning. For example, the preset CPU over-provisioning ratio may be 1.2, the preset memory over-provisioning ratio may be 1.3, and so on.

[0077] Next, check the original server and use the resource monitoring and query tools provided by the corresponding cloud computing management platform to check whether there are cloud hosts in the original server that are currently hosting but not participating in the performance test. This detection process requires traversing the relevant status identifiers of all cloud hosts on the original server and the test tasks to which they belong, so as to accurately determine whether there are such cloud hosts that are not participating in the performance test in the original server.

[0078] If it is found through testing that the original server does carry cloud hosts that did not participate in the performance test, then the migration operation must be carried out. Using the cloud host migration function of the cloud computing platform, according to the established migration process and rules, these cloud hosts that did not participate in the performance test are properly migrated to other suitable servers to ensure that they can run normally in the new server environment. At the same time, the original server after the cloud host migration operation is marked as unloaded, indicating that the original server is currently not carrying cloud hosts that are not related to this performance test.

[0079] Afterwards, for the original server in the idle state, the current actual CPU over-provisioning ratio and memory over-provisioning ratio are obtained again through the corresponding system interface or management tool to grasp its existing resource over-provisioning status information. Then, the CPU over-provisioning ratio and memory over-provisioning ratio of the original server in the idle state are modified and adjusted using the previously extracted preset CPU over-provisioning ratio and preset memory over-provisioning ratio. The specific operation may involve modifying the relevant parameter values ​​in the server configuration file, resetting the over-provisioning ratio through command line instructions, etc., so that the resource over-provisioning situation of the original server meets the preset requirements, and then the original server after the corresponding configuration is completed is obtained.

[0080] Finally, the original servers that have completed the resource over-allocation adjustment through the above series of operations are identified as candidate servers. These candidate servers will serve as the basic resources for further building the cloud resource environment required for testing, creating cloud hosts, and conducting performance testing, to meet the specific requirements for server configuration in the testing process.

[0081] As an example, Figure 3 As shown, first check the server status. If the status is normal, migrate the existing cloud host, and then modify the cpu_ratio and memory_ratio of the server. Then query the server quota. If the quota meets the count requirement, create cloud resources (including vpc, subnet, port, volume, ecs), and then check whether the ecs status is running. If the ecs status is running, end the process. If there is an exception, delete the abnormal ecs and create the same number of ecs. At the same time, check whether the number of executions is less than or equal to 3. If it is less than or equal to 3, repeat the above creation and checking steps. If it is greater than 3, the process ends. If the check fails at any step (the server status is abnormal, the quota is not met, the ecs status is abnormal, and the number of executions exceeds 3), the process ends.

[0082] Step A3: Check whether the candidate server meets the preset conditions for creating a cloud resource environment.

[0083] In the embodiment of the present application, it is checked whether the relevant configuration conditions meet the requirements of the preset conditions for creating the cloud resource environment. For example, if it is checked whether the server quota meets the corresponding count requirements, it will refer to certain standards and established rules for detection. If the conditions are met, the subsequent cloud resource creation (covering vpc, subnet, port, volume, ecs, etc.) operations can be continued according to the process. Then, it is checked whether the status of the created ecs is running. If they are all running, the whole process ends. If there are abnormal ecs, they are deleted and the same number of ecs are created. At the same time, it is checked whether the number of executions is less than or equal to 3. If it is less than or equal to 3, the creation and checking steps are repeated. If it is greater than 3, the process ends. If it is found that the candidate server does not meet the preset conditions (such as insufficient server quota, etc.) when it is detected at the beginning, the whole process ends directly.

[0084] This application extracts the preset CPU over-provisioning ratio and the preset memory over-provisioning ratio from the test parameters, which can clarify the standards for server resource allocation according to the established plan; then it detects whether there are cloud hosts in the original server that have not participated in the performance test, so as to accurately grasp the load situation of the server and conduct targeted resource sorting; when such cloud hosts are found, they are migrated to other servers and the original servers are marked as unloaded, which helps to create a purer environment that is easy to manage and allocate resources; then the CPU and memory over-provisioning ratios of the original server in the unloaded state are obtained, and then modified using the preset corresponding over-provisioning ratios, so as to ensure that the resource over-provisioning of the original server strictly meets the preset requirements and realize accurate resource allocation; finally, the configured original server is used as a candidate server, which lays a solid foundation for the subsequent construction of a cloud resource environment that meets the test requirements, has stable performance and reasonable resource allocation, and for conducting efficient performance testing, thereby improving the standardization and reliability of the entire test process.

[0085] Step A4: if the candidate server meets the preset conditions for creating a cloud resource environment, the creation configuration information of the cloud host is obtained, and the resource environment and the cloud host are created in the configured candidate server using the creation configuration information.

[0086] Specifically, after determining that the candidate server meets the preset conditions for creating a cloud resource environment, the creation configuration information of the cloud host is then obtained, which includes the image information required for creating a cloud host, clarifying its pre-installed software, operating system version, etc.; disk type (volume_type) and size (volume_size) information, determining the performance characteristics and capacity of the storage device; and network-related configuration information such as virtual private cloud (VPC), subnet (subnet), port (port), etc. Then, with the help of the creation interface or management tool provided by the cloud computing platform, based on these detailed creation configuration information, a virtual private cloud (VPC) is created on the configured candidate server in turn, a suitable subnet (subnet) is divided, the corresponding port (port) is configured, a disk (volume) is created and mounted to the corresponding location, and finally a cloud host (ECS) is created, thereby building a complete resource environment and cloud host system, laying the foundation for subsequent testing work.

[0087] Step A5, detecting the status information of the created cloud host. If an abnormality occurs in the cloud host, the abnormal cloud host is deleted and recreated until the cloud resource environment required for the test is obtained.

[0088] Use the cloud host status monitoring tool or related monitoring system that comes with the cloud computing platform to regularly check the status information of the created cloud host, including but not limited to key indicators such as the cloud host's CPU usage, memory usage, network connection stability, disk read and write status, etc. Once the cloud host is found to have abnormal conditions such as failure to start normally, frequent freezes, abnormal resource usage, etc. during the detection process, immediately delete the abnormal cloud host through the management operation of the cloud computing platform, and re-create it according to the previously set creation configuration information and process. Continue to repeat this process of detection and re-creation until all created cloud hosts can run stably and all status indicators meet the requirements, and then successfully obtain the cloud resource environment required for the test to ensure that subsequent performance tests can be carried out smoothly.

[0089] In an embodiment of the present application, determining the target cloud host to be currently subjected to performance testing includes: obtaining the number of cloud hosts for concurrent stress testing, selecting cloud hosts with the same number of hosts from the candidate cloud hosts as candidate cloud hosts, uploading the performance test script to the candidate cloud hosts, and using the candidate cloud hosts configured with the performance test script as the target cloud hosts to be subjected to performance testing.

[0090] Specifically, first, we need to obtain the number of cloud hosts for concurrent stress testing. This number is usually determined based on the test requirements and the test scenarios set in the early stage. It clarifies the scale of cloud hosts that need to be stress tested simultaneously in this performance test. For example, according to the test plan, if 5 cloud hosts are to be stress tested simultaneously, then this number value is 5.

[0091] Next, select from the existing candidate cloud hosts. The candidate cloud hosts may be selected according to certain rules, or they may be cloud hosts that meet some basic conditions and are created in a specific availability zone or server. According to the number of concurrent stress test cloud hosts obtained, a corresponding number of cloud hosts are accurately selected as candidate cloud hosts for further performance testing through random or other reasonable selection methods, such as selecting 5 cloud hosts from a large number of candidate cloud hosts (corresponding to the number of concurrent stress tests set previously).

[0092] Then, prepare the performance test script, which is a key file used to perform various performance test tasks and collect relevant test data. For example, it may contain specific instructions and processes for calling common open source performance test tools such as unixbench and stream, or user-defined applications or tools to carry out performance testing. Use appropriate tools or commands, such as the virsh command, to upload this performance test script to the previously selected candidate cloud hosts, ensuring that each candidate cloud host can obtain the corresponding test script and has the basic conditions for performing performance testing.

[0093] Finally, after the above steps, the candidate cloud hosts that have been configured with performance test scripts become the target cloud hosts for performance testing. The performance testing process can then be officially started for these target cloud hosts.

[0094] As an example, Figure 4 As shown in the figure, firstly, threads cloud hosts are randomly selected, then the performance test script run.sh is uploaded to these cloud hosts, and then run.sh is executed to start the cloud host performance execution monitoring process, and at the same time, the sar process is started to monitor the server load. Then, it is determined whether run.sh has been executed. If not, wait for 30 seconds and check again; if run.sh has been executed, the server monitoring process is stopped, and then the performance result module is obtained, and finally the process ends.

[0095] This application first obtains the status of each original server in the test scenario, so as to clarify the basic situation of each server in advance, provide an accurate reference for subsequent operations, and avoid affecting the overall process due to potential problems in the server itself; then, when the original server status is normal, the candidate server is configured according to the test parameters, which helps to accurately create a server environment that meets the requirements according to the test requirements and ensure the adaptability of subsequent operations; and after the configuration, it is detected whether the candidate server meets the preset conditions for creating a cloud resource environment, so that the situation that may not meet the requirements can be checked in advance, and timely adjustments and optimizations can be made to improve resource utilization efficiency and creation success rate; if the candidate server meets the conditions, the cloud host creation configuration information is used to create a resource environment and a cloud host in it, so that the construction of cloud resources is orderly and standardized, in line with test expectations; finally, the status information of the created cloud host is detected, and once an abnormality occurs, it is deleted and recreated in time until the cloud resource environment required for the test is obtained, which can effectively ensure the stability and reliability of the cloud resource environment, lay a solid foundation for the smooth implementation of related testing work in the future, and minimize the occurrence of inaccurate test results due to environmental problems.

[0096] Step S103, performing a performance test on the target cloud host in the cloud resource environment, obtaining performance test data of the cloud host, and detecting resource usage of the target server where the target cloud host is located.

[0097] In an embodiment of the present application, a performance test is performed on a target cloud host in a cloud resource environment to obtain performance test data of the cloud host, and resource usage of a target server where the target cloud host is located is detected, including the following steps B1-B3:

[0098] Step B1, sending an instruction to execute a performance test to the target cloud host, so that the target cloud host executes the performance test based on the performance test script, and during the performance test of the target cloud host, calling a monitoring process to monitor the CPU usage and memory usage of the server.

[0099] Specifically, first, the instructions for executing the performance test are accurately sent to the target cloud host through a dedicated remote control tool or the command sending interface provided by the cloud computing platform. These target cloud hosts have been pre-configured with the corresponding performance test scripts. After receiving the instructions, the target cloud host will start the performance test process according to the configured performance test script and start to execute various performance test tools such as calling unixbench and stream to carry out the test. At the same time, using the monitoring process on the server side, with the help of professional monitoring tools such as sar, monitoring requests are sent to the server where the target cloud host is located in real time to collect and record the CPU usage of the server, such as the usage rate and load of each core, and the memory usage, such as the memory usage, the free memory ratio and other key indicator information, so as to realize the dynamic monitoring of the server resource usage status and provide data support for the subsequent analysis of the impact of performance testing on server resources.

[0100] Step B2: Detect the test progress of the performance test of the target cloud host according to a preset time period.

[0101] Specifically, with the help of a timer or a time period setting function built into the test management system, a test progress query request is initiated to the target cloud host that is performing the performance test through the corresponding status query interface or detection tool at a pre-set time period, such as every 30 minutes or 1 hour. These requests will obtain the execution phase information of the performance test task on the target cloud host, such as the number of completed test cases, ongoing test links, and the estimated remaining time of the overall test task, so as to clearly grasp the real-time progress of the performance test of the target cloud host and ensure that the entire test process is in a monitorable and controllable state.

[0102] Step B3: If it is detected that the test progress is in a completed state, the performance test data of the cloud host is obtained, and the resource usage of the target server where the target cloud host is located is detected.

[0103] Specifically, if it is found that the test progress of the target cloud host is in the completed state, that is, all performance test tasks have been successfully executed, the generated performance test data will be extracted from the target cloud host through a specific data collection interface or command. These data cover the various indicator results output by different performance testing tools, such as network throughput, disk read and write speed, computing task response time and other detailed information. After obtaining the performance test data, the server resource monitoring tool is used to detect the resource usage of the target server where the target cloud host is located at this time, including the average CPU usage, peak usage, memory usage peak, average usage and other indicators. By comparing the changes in server resources before and after the performance test, the target cloud host's consumption of server resources and overall performance during this performance test are comprehensively evaluated, providing a basis for subsequent result analysis and optimization.

[0104] Step S104: Analyze resource usage and performance test data to obtain the performance of the cloud host.

[0105] In the embodiment of the present application, analyzing resource usage and performance test data to obtain the performance of the cloud host includes the following steps C1-C3:

[0106] Step C1, extracting key data from performance test data according to the number of performance executions.

[0107] Specifically, first, clearly set the parameter of the number of performance executions, and use it to sort out the performance test data. From the numerous and complex performance test data, select the corresponding key data according to the established rules and key indicators of concern. For example, if the number of performance executions is 10 times, then extract the core indicator data generated by each of the 10 tests, such as the output of different performance testing tools (such as the extreme and average throughput in the network performance test, the maximum response time in the computing performance test, etc.), and filter out these data that can reflect the core performance of the cloud host and are of great significance to the evaluation of its overall performance, forming a key data set to prepare for further analysis of the cloud host performance.

[0108] Step C2, obtaining the average CPU usage and average memory usage of the server during the performance test.

[0109] Specifically, with the help of the server resource monitoring mechanism that has been started and continuously running during the performance test, through its recording and statistical functions, the data recording part related to the server CPU and memory usage is located. From it, the relevant values ​​of the average CPU usage during the entire performance test are found and obtained, that is, the average proportion of CPU resources occupied during the entire test period is counted; at the same time, the data of the average memory usage is obtained, that is, the average proportion of memory used during the entire performance test is calculated. These data reflect the resource consumption level of the server when carrying the cloud host performance test, and are an important reference for analyzing the impact on cloud host performance.

[0110] Step C3: Analyze key data, average CPU usage, and average memory usage to obtain the performance of the cloud host.

[0111] Specifically, the extracted key data, as well as the obtained data on the average CPU usage and average memory usage of the server are brought together. Using professional data analysis methods and relevant performance evaluation models, the relationship between these data and the performance status reflected by each data are comprehensively considered from different dimensions. For example, the fluctuation of performance indicators under different execution times in key data is compared, and the resource utilization efficiency is judged reasonable in combination with the average CPU and memory usage, and then a comprehensive analysis is conducted to obtain the performance of the cloud host in terms of computing power, network transmission, storage reading and writing, etc., so as to accurately grasp the overall performance of the cloud host, so as to make corresponding decisions based on the analysis results in the future, such as whether the cloud host configuration needs to be optimized and adjusted.

[0112] This application solves the problems existing in the manual test mode from multiple key links. At the beginning of the test, by obtaining the test parameters of different test dimensions input by the user, the test requirements are accurately controlled, avoiding the arbitrariness and incompleteness of parameter determination in manual testing. When building a cloud resource environment, the original server status is first obtained. For the original server in normal status, the candidate server is configured according to the test parameters, and it is also detected whether it meets the preset conditions. If it meets the conditions, the cloud host creation configuration information is further obtained to create the resource environment and cloud host, and when the cloud host is abnormal, it is automatically deleted and recreated until it meets the requirements. The whole process replaces the complicated and error-prone operation of manually building the environment. In the configuration of candidate servers, the preset CPU over-allocation ratio and memory over-allocation ratio are extracted, the cloud hosts that are not involved in the test are reasonably migrated, and the relevant ratios of the unloaded original servers are accurately modified to determine the candidate servers, ensuring the scientificity and standardization of the configuration. When determining the target cloud host, the performance test script is automatically selected and uploaded based on the number of concurrent stress test cloud hosts obtained to avoid the blindness of manual selection. During the performance testing phase, instructions are sent to the target cloud host to automatically execute the test based on the script. At the same time, the test progress is checked according to the preset time period. When completed, the performance test data is automatically obtained and the server resource usage is checked. This series of automated processes replaces the inefficient and error-prone manual operation, recording and judgment in manual testing, which improves the test efficiency in all aspects and reduces human errors, thereby meeting the complex needs of cloud host performance testing in a cloud computing environment.

[0113] In the embodiment of the present application, after analyzing the resource usage and performance test data to obtain the performance of the cloud host, the method further includes: detecting the number of scenarios of the test scenario. If the number of scenarios of the test scenario is multiple, reading whether to clear the target parameter of the resource configuration, if the target parameter does not exist, then not performing a cleanup operation on the cloud resource environment. Or, if the number of scenarios of the test scenario is not multiple, then performing a cleanup operation on the cloud resource environment.

[0114] Specifically, the number of all currently existing test scenarios is detected to clarify the specific number of scenarios. Next, a judgment is made. If it is detected that there are multiple test scenarios, then the target parameter corresponding to the resource configuration is read to determine whether to clear it. After reading the target parameter, if it is found that it does not exist, it means that according to the established rules, the cloud resource environment will not be cleaned up at this time to retain the existing cloud resource environment for subsequent use or further operations; and if it is detected that there are not multiple test scenarios, that is, there is only one or there are no multiple scenarios, then according to the preset cleanup process, the corresponding resource management tools or commands will be used to uniformly perform cleanup operations on the constructed cloud resource environment, including cloud hosts, virtual private clouds, subnets, ports, disks and other related resources, to ensure that the resource status meets the corresponding requirements, such as releasing resources to rebuild the test environment next time.

[0115] As an example, Figure 5 As shown, first determine whether the test is a single scene. If it is a single scene, read the clean environment parameter clean, and then determine whether clean is equal to false. If clean is equal to false, no cleanup operation is performed and the process ends; if clean is not equal to false, all resources are cleaned up, and then the process ends. If the test is not a single scene, all resources are cleaned up directly, and finally the process ends.

[0116] In this embodiment, a cloud host performance testing device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and will not be repeated here. As used below, the term "module" can implement a combination of software and / or hardware for a predetermined function. Although the devices described in the following embodiments are preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceivable.

[0117] This embodiment provides a cloud host performance testing device, such as Figure 6 As shown, including:

[0118] The acquisition module 601 is used to acquire the test parameters of different test dimensions input by the user.

[0119] The determination module 602 is used to construct the cloud resource environment required for the test using the test parameters and determine the target cloud host for the current performance test.

[0120] The testing module 603 is used to perform a performance test on the target cloud host in the cloud resource environment, obtain performance test data of the cloud host, and detect resource usage of the target server where the target cloud host is located.

[0121] The analysis module 604 is used to analyze resource usage and performance test data to obtain the performance of the cloud host.

[0122] In an embodiment of the present application, the determination module 602 is used to obtain the status of each original server in the test scenario. If the status of the original server is normal, the original server is configured according to the test parameters to obtain a candidate server. Check whether the candidate server meets the preset conditions for creating a cloud resource environment. If the candidate server meets the preset conditions for creating a cloud resource environment, obtain the creation configuration information of the cloud host, and use the creation configuration information to create a resource environment and a cloud host in the configured candidate server. Check the status information of the created cloud host. If an abnormality occurs in the cloud host, delete the abnormal cloud host and recreate it until the cloud resource environment required for the test is obtained.

[0123] In the embodiment of the present application, the determination module 602 is used to extract the preset CPU over-provisioning ratio and the preset memory over-provisioning ratio from the test parameters and to detect whether the original server carries a cloud host that does not participate in the performance test.

[0124] If the original server carries a cloud host that does not participate in the performance test, migrate the cloud host that does not participate in the performance test to other servers, and mark the migrated original server as unloaded. Obtain the CPU over-provisioning ratio and memory over-provisioning ratio of the original server in the unloaded state, and modify the CPU over-provisioning ratio and memory over-provisioning ratio using the preset CPU over-provisioning ratio and the preset memory over-provisioning ratio respectively to obtain the configured original server. Use the configured original server as a candidate server.

[0125] In the embodiment of the present application, the determination module 602 is used to obtain the number of cloud hosts for concurrent stress testing, select cloud hosts with the same number of hosts from the candidate cloud hosts as candidate cloud hosts, upload the performance test script to the candidate cloud hosts, and use the candidate cloud hosts configured with the performance test script as target cloud hosts to be subjected to performance testing.

[0126] In the embodiment of the present application, the test module 603 is used to send an instruction to execute the performance test to the target cloud host, so that the target cloud host executes the performance test based on the performance test script, and calls the monitoring process to monitor the CPU usage and memory usage of the server during the performance test of the target cloud host. The test progress of the performance test of the target cloud host is detected according to a preset time period. If it is detected that the test progress is in a completed state, the performance test data of the cloud host is obtained, and the resource usage of the target server where the target cloud host is located is detected.

[0127] In the embodiment of the present application, the analysis module 604 is used to extract key data from the performance test data according to the number of performance executions. The average CPU usage and the average memory usage of the server during the performance test are obtained. The key data, the average CPU usage and the average memory usage are analyzed to obtain the performance of the cloud host.

[0128] In an embodiment of the present application, the device further includes: a cleaning module, which is used to detect the number of scenarios of the test scenario. If the number of scenarios of the test scenario is multiple, read whether to clear the target parameter of the resource configuration, and if the target parameter does not exist, do not perform a cleaning operation on the cloud resource environment. Or, if the number of scenarios of the test scenario is not multiple, perform a cleaning operation on the cloud resource environment.

[0129] See also Figure 7 , Figure 7 is a schematic diagram of the structure of an electronic device provided by an optional embodiment of the present invention, such as Figure 7 As shown, the electronic device includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the electronic device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple electronic devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Figure 7 A processor 10 is taken as an example.

[0130] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.

[0131] The memory 20 stores instructions executable by at least one processor 10, so that the at least one processor 10 executes the method shown in the above embodiment.

[0132] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required for at least one function; the data storage area may store data created by the use of an electronic device based on the presentation of a small program landing page, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the electronic device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.

[0133] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.

[0134] The electronic device further comprises a communication interface 30 for the electronic device to communicate with other devices or a communication network.

[0135] The embodiment of the present invention also provides a computer-readable storage medium. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium through a network download, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor controller, or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor, or hardware, the method shown in the above embodiment is implemented.

[0136] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.

Claims

1. A method for testing cloud host performance, characterized in that: The method comprises: Get the test parameters of different test dimensions input by the user; Using the test parameters to build the cloud resource environment required for the test, and determine the target cloud host for the current performance test; Performing a performance test on the target cloud host in the cloud resource environment to obtain performance test data of the cloud host, and detecting resource usage of the target server where the target cloud host is located; The resource usage and the performance test data are analyzed to obtain the performance of the cloud host.

2. The method according to claim 1, characterized in that: The using the test parameters to construct a cloud resource environment required for the test includes: Get the status of each origin server in the test scenario; If the state of the original server is normal, configuring the original server according to the test parameters to obtain a candidate server; Detecting whether the candidate server meets the preset conditions for creating a cloud resource environment; If the candidate server meets the preset conditions for creating the cloud resource environment, obtaining the creation configuration information of the cloud host, and using the creation configuration information to create the resource environment and the cloud host in the configured candidate server; Check the status information of the created cloud host. If the cloud host has an abnormal situation, delete the abnormal cloud host and recreate it until the cloud resource environment required for the test is obtained.

3. The method according to claim 2, characterized in that The configuring the original server according to the test parameters to obtain a candidate server includes: Extracting a preset CPU over-provisioning ratio and a preset memory over-provisioning ratio from the test parameters; Detecting whether the original server carries a cloud host that does not participate in the performance test; If the original server carries a cloud host that does not participate in the performance test, the cloud host that does not participate in the performance test is migrated to another server, and the migrated original server is marked as being in an unloaded state; Obtaining a CPU over-provisioning ratio and a memory over-provisioning ratio of an original server in an unloaded state, and respectively modifying the CPU over-provisioning ratio and the memory over-provisioning ratio using the preset CPU over-provisioning ratio and the preset memory over-provisioning ratio to obtain a configured original server; Use the configured original server as a candidate server.

4. The method according to claim 1, characterized in that Determining the target cloud host to be currently subjected to the performance test includes: Get the number of cloud hosts for concurrent stress testing; A number of cloud hosts are selected from a plurality of cloud hosts as candidate cloud hosts, and a performance test script is uploaded to the candidate cloud hosts, and the candidate cloud hosts configured with the performance test script are used as target cloud hosts to be subjected to performance testing.

5. The method according to claim 4, characterized in that The step of performing a performance test on the target cloud host in the cloud resource environment to obtain performance test data of the cloud host and detecting resource usage of a target server where the target cloud host is located includes: Sending an instruction to execute a performance test to the target cloud host, so that the target cloud host executes the performance test based on the performance test script, and calling a monitoring process to monitor the CPU usage and memory usage of the server during the performance test of the target cloud host; Detecting the test progress of the performance test of the target cloud host according to a preset time period; If it is detected that the test progress is in a completed state, the performance test data of the cloud host is obtained, and the resource usage of the target server where the target cloud host is located is detected.

6. The method according to claim 1, characterized in that The analyzing the resource usage and the performance test data to obtain the performance of the cloud host includes: extracting key data from the performance test data according to the number of performance executions; Obtain the average CPU usage and average memory usage of the server during the performance test; The key data, the average CPU usage, and the average memory usage are analyzed to obtain the performance of the cloud host.

7. The method according to claim 1, characterized in that After analyzing the resource usage and the performance test data to obtain the performance of the cloud host, the method further includes: The number of scenarios to detect test scenarios; If there are multiple test scenarios, read whether to clear the target parameter of resource configuration, and if the target parameter does not exist, do not perform a cleanup operation on the cloud resource environment; Or, if the number of scenarios in the test scenario is not multiple, a cleanup operation is performed on the cloud resource environment.

8. A cloud host performance testing device, characterized in that: The device comprises: An acquisition module is used to obtain test parameters of different test dimensions input by the user; A determination module is used to construct a cloud resource environment required for the test using the test parameters and determine a target cloud host for the current performance test; A testing module, used to perform a performance test on the target cloud host in the cloud resource environment, obtain performance test data of the cloud host, and detect resource usage of the target server where the target cloud host is located; The analysis module is used to analyze the resource usage and the performance test data to obtain the performance of the cloud host.

9. An electronic device, characterized in that: include: A memory and a processor, wherein the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the method according to any one of claims 1 to 7 by executing the computer instructions.

10. 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 computer to execute the method according to any one of claims 1 to 7.

Citation Information

Cited By

  • Equipment detection method and electronic equipment

    CN120723559A