CN111124850A - MQTT server performance testing method, system, computer equipment and storage medium - Google Patents

MQTT server performance testing method, system, computer equipment and storage medium Download PDF

Info

Publication number
CN111124850A
CN111124850A CN201911100308.2A CN201911100308A CN111124850A CN 111124850 A CN111124850 A CN 111124850A CN 201911100308 A CN201911100308 A CN 201911100308A CN 111124850 A CN111124850 A CN 111124850A
Authority
CN
China
Prior art keywords
test
container
target
file
module
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201911100308.2A
Other languages
Chinese (zh)
Inventor
汪琦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shanghai Mobile Communication Technology Co Ltd
Original Assignee
Shanghai Mobile Communication Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shanghai Mobile Communication Technology Co Ltd filed Critical Shanghai Mobile Communication Technology Co Ltd
Priority to CN201911100308.2A priority Critical patent/CN111124850A/en
Publication of CN111124850A publication Critical patent/CN111124850A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management
    • G06F11/3688Test management for test execution, e.g. scheduling of test suites
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/30Monitoring
    • G06F11/34Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment
    • G06F11/3409Recording or statistical evaluation of computer activity, e.g. of down time, of input/output operation ; Recording or statistical evaluation of user activity, e.g. usability assessment for performance assessment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3664Environments for testing or debugging software
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F11/00Error detection; Error correction; Monitoring
    • G06F11/36Preventing errors by testing or debugging software
    • G06F11/3668Software testing
    • G06F11/3672Test management

Abstract

The embodiment of the invention relates to the field of server performance testing, and discloses a method and a system for testing MQTT server performance, computer equipment and a storage medium. The invention discloses a method for testing MQTT server performance, which comprises the following steps: receiving a test file to be tested and a test requirement, wherein the test requirement limits the test scale of the test file to be operated; deploying a plurality of target containers for executing the test files on a preset cloud platform according to the test files; selecting at least one target container in the multiple target containers according to the test requirement to generate a test process; and performing data integration on the test result of the test process according to a preset data template to generate a test result. According to the method and the device, the received files are started to be container applications and are deployed on the preset cloud platform in a one-key mode, the test scale is adjusted according to the test requirements, and the test results are collected in a one-key mode.

Description

MQTT server performance testing method, system, computer equipment and storage medium
Technical Field
The embodiment of the invention relates to the field of server performance testing, in particular to a method and a system for testing MQTT server performance, computer equipment and a storage medium.
Background
Based on the MQTT protocol, the method has small transmission consumption and protocol data exchange, can reduce network flow to the maximum extent, and keeps lower electric quantity consumption and more efficient communication effect for the client side of the Internet of things. The technical scheme of the MQTT protocol can support million-level Internet of things clients, but for the conditions of higher traffic, instantaneous network request peak fluctuation and the like, the traffic reaches over million levels or the request frequency is too high, the bottleneck of the performance of the MQTT protocol can be touched, and the service background can be possibly crashed, so that the performance of a server based on the MQTT protocol needs to be tested during delivery implementation. In the prior art, a plurality of test servers are specially dialed to simulate millions of clients to test the number of static connections, and during testing, one log-in server is needed, then a corresponding test script or program is copied to the server, and an operating environment corresponding to the script or program is also needed to be installed. The test logs generated in the traditional mode are distributed in each server, and the test results are obtained through manual collection and analysis.
The inventor finds that at least the following problems exist in the prior art: in the prior art, the test of the number of static connections is carried out, reasonable distribution can not be carried out according to the resource condition of a server, and the test scale can not be modified according to the test condition in the test process; in addition, in the test preparation stage, one login server needs to be deployed manually, and the manual execution mode has extremely low efficiency; in addition, the test result is complicated and time-consuming to gather.
Disclosure of Invention
The embodiment of the invention aims to provide a method, a system, computer equipment and a storage medium for testing the performance of an MQTT server, so that the detection efficiency is greatly improved.
In order to solve the above technical problems, an embodiment of the present invention provides a method for testing MQTT server performance, including the following steps: receiving a test file to be tested and a test requirement, wherein the test requirement limits the test scale of the test file to be operated; deploying a plurality of target containers for executing the test files on a preset cloud platform according to the test files; selecting at least one target container in the multiple target containers according to the test requirement to generate a test process; and performing data integration on the test result of the test process according to a preset data template to generate a test result.
The embodiment of the invention also provides an MQTT server performance test system, which comprises: the storage module is used for receiving and storing the test files and the test requirements, wherein the test requirements limit the test scale of the running test files; the container deployment module is used for deploying a plurality of target containers for executing the test files on a preset cloud platform according to the test files; a task execution module: the system comprises a test process generation module, a test module and a test module, wherein the test process generation module is used for selecting at least one target container in a plurality of target containers according to a test requirement to generate a test process; and the result generation module is used for carrying out data integration on the test result of the test process according to a preset data template to generate a test result.
An embodiment of the present invention also provides a computer device, including: at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the MQTT server performance testing method.
The embodiment of the invention also provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the MQTT server performance testing method.
Compared with the prior art, the embodiment of the invention has the advantages that the received test files are started to be the container application and are deployed on the preset cloud platform by one key, a plurality of test servers do not need to be specially dialed, the test files can be automatically distributed to corresponding idle resources, and the servers do not need to be manually deployed one by one, so that the preparation work before the test is greatly simplified; the test case is operated by the construction container, so that the program for constructing the test environment can be simplified, and the test efficiency is improved. In addition, at least one target container in the multiple target containers can be selected according to the test requirements to generate a test process, and the mode of adjusting the test scale according to the test requirements at any time is more suitable for the requirements of pressure tests; according to the invention, the test result is generated by integrating the preset data template into one key, the trouble of manually collecting and counting the test result one by one is avoided, the implementation mode is more convenient and faster compared with the traditional test method, and the test efficiency and accuracy are improved.
In addition, the test file comprises a configuration file, and deploying a plurality of target containers for executing the test file on a preset cloud platform according to the test file comprises the following steps: deploying a plurality of target containers for executing the test files on the cloud platform according to the configuration files and generating version numbers of the target containers. In the embodiment of the invention, the test programs are deployed by one key according to the configuration file, the operation is convenient and fast, and the test programs are carried out in corresponding containers without mutual interference; in addition, when a new test is needed to modify the test program, only the new version needs to be containerized again, and the version number of the corresponding target container needs to be modified, so that manual replacement of one server by one server is not needed, and the test efficiency is further improved.
In addition, after the test result of the test process is subjected to data integration according to a preset data template to generate a test result, the method further comprises the following steps: receiving a control instruction for reducing the test scale; and deleting the corresponding number of target containers in the test process according to the control instruction. The number of the target containers deployed in the cloud platform can be adjusted according to the generated test result, namely when the test limit is exceeded, a part of target containers in the test process are deleted according to a control instruction which is sent from the outside and reduces the test scale, so that a more reasonable and accurate test result is obtained; and when the testing process is finished, deleting the target container and releasing the resources in the cloud platform.
In addition, the data integration of the test result of the test process according to the preset data template to generate the test result comprises the following steps: collecting log information generated by each target container in a test process; extracting test data in each log information according to a preset data template; and integrating the test data in the log information according to the number of the corresponding target container to generate a test result. The logs generated by the containers are collected and counted through one key according to the preset data template, the test results do not need to be checked one by one manually, and the log collection is not needed to be analyzed and counted manually, so that the test results are visualized, and the burden of testers is reduced.
In addition, the MQTT server performance testing method also comprises the steps of receiving a monitoring instruction; collecting the performance indexes of a target container in the test process according to the monitoring instruction, wherein the container performance indexes comprise: CPU, memory and network I/O resource consumption; the resource consumption of the test script or program can be accurately observed, so that the iteration of the test script or program is promoted, and the quality of the test script or program is improved.
Drawings
One or more embodiments are illustrated by the corresponding figures in the drawings, which are not meant to be limiting.
FIG. 1 is a flow chart of a method for testing the performance of an MQTT server according to a first embodiment of the invention;
FIG. 2 is an architecture diagram of MQTT server performance testing in a second embodiment of the invention;
FIG. 3 is a flow chart of a method for testing the performance of an MQTT server according to a second embodiment of the invention;
FIG. 4 is a diagram of the resource consumption result of MQTT server performance test according to the second embodiment of the invention;
FIG. 5 is a block diagram of a MQTT server performance testing system according to a third embodiment of the invention;
FIG. 6 is another structural diagram of a MQTT server performance testing system in a third embodiment of the invention;
fig. 7 is a block diagram of a computer apparatus according to a fourth embodiment of the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present invention more apparent, embodiments of the present invention will be described in detail below with reference to the accompanying drawings. However, it will be appreciated by those of ordinary skill in the art that numerous technical details are set forth in order to provide a better understanding of the present application in various embodiments of the present invention. However, the technical solution claimed in the present application can be implemented without these technical details and various changes and modifications based on the following embodiments. The following embodiments are divided for convenience of description, and should not constitute any limitation to the specific implementation manner of the present invention, and the embodiments may be mutually incorporated and referred to without contradiction.
The first embodiment of the invention relates to a method for testing the performance of an MQTT server. The embodiment realizes one-key deployment of the test files, greatly improves the utilization rate of the hardware resources of the server and the test efficiency, and the specific flow is shown in figure 1.
Step 101: test files to be tested and test requirements are received.
Specifically, receiving a test file and a test requirement uploaded by a tester, wherein the test file can be a test program or a test script, and the test file is subjected to containerization processing, wherein the containerization processing is to pack the test file into a standard unit for development, delivery and deployment; the test requirements define the test scale for running the test file.
In one example, a developer provides a test program or a script written in a computer language, and the tester uses a Dockerfile file to compile and store the obtained test program or script into a Docker image in an image warehouse. The test requirements can be written in a statement file by a tester in advance, such as the number of MQTT clients simulated in one test process and the like.
Step 102: and deploying a plurality of target containers for executing the test files on a preset cloud platform according to the test files.
Specifically, a tester starts a container in a Docker image corresponding to a test file to preview a program execution result, and if an expected result is met, the Docker image is pushed to a remote image warehouse to be stored for pulling of a subsequent test. The method comprises the steps of accessing cloud platform services to a distributed cluster server in advance, creating test nodes on the cloud platform, determining a main control node and task nodes in the node creating process, pulling a target container from a remote mirror image warehouse and pushing the target container to the task nodes of the cloud platform for service deployment, wherein the target container is an environment which is independently operated and is necessary for testing applications and test cases.
In one example, installation of the cloud platform kubernets may be performed automatically in the distributed cluster servers in the form of invoking an installation configuration file by a user through an input instruction. Or, the user edits the configuration parameters in a visual editing interface containing various configuration parameters, and after the editing is completed, an installation command is automatically triggered to carry out Kubernets installation. The system realizes the deployment of the Kubernets cluster according to the relevant configuration parameters, including the installation of an ETCD database, the installation of a main control node, the installation of a task node, the deployment of system components and the like. The ETCD database in the Kubernetes system is a storage system providing defaults for a Kubernetes cluster, is used for storing cluster data and mainly stores persistent data of each module; the master node (master) is also called a control node and is a management and control center of the whole Kubernets cluster, and the task node (work) is responsible for carrying container operation and is a host of the container. According to the information in the statement file, a Docker image corresponding to the test file is pulled from a remote image warehouse, an external environment for executing the test program is configured, a corresponding container version number is selected, a Pod template is created, and the Pod version number is redundantly deployed on a kubernets platform through a Deployment module in kubernets.
Step 103: and selecting at least one target container in the plurality of target containers according to the test requirement to generate a test process.
Specifically, the test scale is limited in the test requirement, one Pod is quickly started in the cloud platform or a plurality of Pod generation test processes are simultaneously generated in batches according to the size of the test scale, and the number of the pods can be adjusted according to the actual test requirement in the test process.
In one example, a Pod is the smallest deployable unit that can create and manage kubernets computations, and a Pod represents a process running in a cluster and consists of one or more containers. When the test task is released, a Deployment module in Kubernetes selects a test node to execute the test task. Here, Kubernetes quickly starts a Pod to execute a test task, and after the test task is executed, the Pod is quickly destroyed. In this way, the Deployment module can create multiple pods in batch at the same time for testing according to the test requirements in the pre-declared file. In this embodiment, when a corresponding target container in Pod fails, kubbellet (container scheduling system) in Kubernetes automatically restarts the container to maintain the operation of the corresponding number of target containers.
In the testing process, the created pots run in the corresponding work nodes to consume resources of the server, the Master node on the Kubernets platform supervises the running states of the remaining resources and the pots in the work nodes, and when available resources on a certain work node are insufficient, the Master node allocates a testing task to the work node with idle resources to ensure the normal running of a testing process.
In one example, where the number of Pod to run is determined in the test requirements, kubernets ensure that a specified number of Pod "copies" are running at any time. If a Pod is specified to have 3 copies, the system will create 3 pods and continue to monitor them. If a Pod does not respond, it is replaced, keeping the total number 3. If the previously unresponsive Pod recovers, now 4 pods, then the system will keep one of the terminations to a total of 3. If the total number of copies is changed to 5 in the run, the system will immediately start 2 new Pod, guaranteeing a total of 5. Pod can also be scaled down in this manner. In practical application, because each pod inside the cluster in Kubernetes is assigned with a unique IP address, a user program can be connected with each pod through a corresponding port number without conflict, that is, a user can manually manage the pods through a Kubernetes API, and the purpose of testing automatic expansion and contraction capacity is achieved.
Step 104: and performing data integration on the test result of the test process according to a preset data template to generate a test result.
Specifically, log information generated by a test process is collected, test data in each log information is extracted according to a preset data template, and the collected test data is integrated to generate a test result.
In one example, each pod will print the generated logs in a fixed path, each server is provided with a monitoring agent, the log generation condition of each server is monitored, and when the log generation is monitored, the test logs are collected and put into a database of the EFK system, and can be visually seen through an interface. The EFK log analysis system is composed of three services of fluent, elastic search and kibana, and is a system for collecting, persisting, analyzing and displaying logs in a Kubernets ecology. By using the mode that the EFK log analysis system in the kubernets ecosystem views the performance test result, the log collection analysis and statistics are not needed to be manually viewed one by one, and the log result which is analyzed and counted can be directly viewed through a webpage, so that the method is clear at a glance.
In the first embodiment of the invention, the received test file is started as a container application and is deployed on the preset cloud platform by one key, and the characteristic of automatic monitoring and scheduling of the cloud platform is utilized, so that the test tasks can be automatically allocated to corresponding idle resources, manual login and deployment of servers one by one are not needed, and the preparation work before testing is greatly simplified; in addition, at least one target container in the multiple target containers can be selected according to the test requirements to generate a test process, and the accuracy of the test result is ensured by utilizing the characteristic that the containers are not interfered with each other in the way that the test case runs through the containers; according to the invention, the test result is generated by integrating the preset data template into one key, the trouble of manually collecting and counting the test result one by one is avoided, the implementation mode is more convenient and faster compared with the traditional test method, and the test efficiency and accuracy are improved.
The second embodiment of the invention relates to a method for testing the performance of an MQTT server. The second embodiment is substantially the same as the first embodiment, and in the second embodiment of the present invention, a plurality of target containers for executing a test file are deployed on a cloud platform according to a configuration file in the test file, and a version number of the target container is generated; the control instruction for reducing the test scale can be accepted to delete the target containers with the corresponding quantity in the test process or after the test is finished; in the testing process, the performance indexes of the target container can be collected according to the monitoring instruction and displayed in a chart form. The second embodiment of the invention realizes one-key deployment of the test program according to the configuration file, can perform one-key capacity expansion or capacity reduction processing according to the test requirement and the idle resources of the server after the performance test is started, improves the utilization rate of the hardware resources of the server and the test efficiency, and vividly shows the test quality through the chart in the test process so as to facilitate the promotion of the quality of pushing the test script or the program.
In the embodiment, the architecture shown in fig. 2 is adopted, the MQTT simulation client may be written in python or other programming languages, external information is collected through the sensor, the collected information is packaged into a data packet lattice conforming to the MQTT protocol and transmitted through the TCP protocol, and a specific test flow is shown in fig. 3.
Step 201: test files to be tested and test requirements are received.
Specifically, a test file and a test requirement uploaded by a user are received, the test file comprises a test case written by a programmer and a configuration file written by the tester in advance, wherein the test case can be a containerized test program or a script, and the test requirement defines the test scale for running the test file.
In one example, a developer provides a test program or a script written in a computer language, and the tester uses a Dockerfile file to process, compile and store the obtained test program or script in a Docker image of an image warehouse. The configuration file is a declaration file pre-written by the tester, such as a Yaml file, containing the path of the remote image repository, the name of the image used, the version number of the container, the external environment variables for program execution, the number of execution simulators, and so on. The test requirements can also be written in a statement file by a tester in advance to specify the test scale, such as the number of MQTT clients simulated in a specified test process, and the like.
Step 202: deploying a plurality of target containers for executing the test files on the cloud platform according to the configuration files and generating version numbers of the target containers.
Specifically, a tester starts a container in a corresponding Docker image to preview a program execution result, and if the expected result is met, the Docker image is pushed to a remote image warehouse to be stored and generate a corresponding container version number for subsequent pulling according to the version number. The method comprises the steps of accessing cloud platform services to a distributed cluster server in advance, creating test nodes on the cloud platform, determining a main control node and task nodes in the node creating process, and pushing a target container to the task nodes of the cloud platform for service deployment.
In one example, installation of the cloud platform kubernets may be performed automatically in the distributed cluster servers in the form of invoking an installation configuration file by a user through an input instruction. Or, the user edits the configuration parameters in a visual editing interface containing various configuration parameters, and after the editing is completed, an installation command is automatically triggered to carry out Kubernets installation. The system realizes the deployment of the Kubernets cluster according to the relevant configuration parameters, including the installation of an ETCD database, the installation of a main control node, the installation of a task node, the deployment of system components and the like. The ETCD database in the Kubernetes system is a storage system providing defaults for a Kubernetes cluster, is used for storing cluster data and mainly stores persistent data of each module; the master node (master) is also called a control node and is a management and control center of the whole Kubernets cluster, and the task node (work) point is responsible for carrying container operation and is a host of the container. According to the information in the Yaml file, a Docker mirror image corresponding to the test file is pulled from a remote mirror image warehouse, an external environment for executing the test program is configured, a corresponding container version number is selected, a Pod template is created, and the Pod template is redundantly deployed on a kubernets platform through a Deployment module in Kubernets, wherein the redundant Deployment mode can be that a containerized test case is deployed on at least one work node of the kubernets platform.
In one example, when a customer proposes a modified test case, a programmer needs to rewrite a test program or a script, the test program or the script is recompiled into a Docker image after the rewriting, the tester starts a container in the corresponding Docker image to preview an execution result of a new program, and if an expected result is met, the modified Docker image is pushed to a remote image warehouse to be stored and updated to generate a corresponding container version number. When the new test case is started, only the version number of the container needs to be modified correspondingly in the Yaml file, for example, the version number of the previous target container is V1, and now only the V1 version needs to be modified into the V2 version, that is, the container version number on the master node is modified by using a kubecult container scheduling system and the new test case is rerun. In the embodiment, when the test scheme is adjusted according to the requirement change, the old programs do not need to be deleted one by one and the new programs do not need to be deployed one by one manually, and only the version number of the target container needs to be changed, so that the test efficiency is improved.
Step 203: and selecting at least one target container in the plurality of target containers according to the test requirement to generate a test process.
Specifically, the test scale is limited in the test requirement, one Pod is quickly started in the cloud platform or a plurality of Pod generation test processes are simultaneously generated in batches according to the size of the test scale, and the number of the pods can be adjusted according to the actual test requirement in the test process.
In one example, as shown in Table 1, kubernets performed a mqtt-testing test service, opening 8 Pods, where each Pod simulates 2 ten thousand mqtt clients. The results are shown in table 2, i.e., a total of 16 ten thousand mqtt clients were simulated; since there are two clients originally, a total of 160002 clients are online in the test system. In practical applications, since each pod inside the cluster in Kubernetes is assigned a unique IP address, the user program can connect each pod through the corresponding port number without conflict, i.e., the user can manually edit the number of pods through the Kubernetes API to adjust the number of simulated clients.
Table one: pod create results in kubernets
Name (R) Label (R) Container set
mqtt-testing Name:mqtt-testing 8/8
Table two: simulating client results
Clients/Count Clients/Max Topics/Count Topics/Max
160002 180003 2 6
In the testing process, the created pots run in the corresponding work nodes to consume resources of the server, the Master node on the Kubernets platform supervises the running states of the remaining resources and the pots in the work nodes, and when available resources on a certain work node are insufficient, the Master node allocates newly-added or running testing tasks to the work nodes with idle resources to ensure the normal running of the testing process.
Step 204: and carrying out data integration on the test result of the test process according to a preset data template to generate a test result.
Specifically, the method comprises the following steps: collecting log information generated by each target container in a test process; extracting test data in each log information according to a preset data template; and integrating the test data in the log information according to the number of the corresponding target container to generate a test result.
In one example, log information generated by each target container is collected through an EFK log analysis system in a Kubernetes ecology, the log information corresponding to each target container is extracted and analyzed, and a result is stored in a database and is checked by a tester through a network interface. As shown in table 3, each Pod is a simulator, simulating a virtual server host, and the log of all tested pods in the distributed server can be clearly seen in the figure, including time consumption, corresponding server host, number of connected clients, number of failed clients, and so on. In practical application, a user initially accesses 10 ten thousand simulation clients at a time according to the capability of the server to start testing, but in order to know the maximum bearing limit of the server, the testing result in the testing process can be checked according to the webpage in the testing process, the number of the connected clients can be increased in a stepwise increasing manner, for example, the number of the clients is 10 ten thousand, 5 ten thousand or 2 ten thousand, and the critical pressure point of the server can be found more accurately. By using the mode that the EFK log analysis system in the kubernets ecosystem is used for checking the performance test results, the logs can be directly checked through the webpage without checking one by one manually or performing log collection analysis statistics manually, and the log results which are analyzed and counted are clear at a glance.
Table 3: EFK partial log results
Figure BDA0002269655980000091
Step 205: and receiving a control instruction for reducing the test scale, and deleting a corresponding number of target containers in the test process according to the control instruction.
Specifically, according to a test result and an actual test requirement, a tester can send a control instruction for reducing the test scale in a test process, and the cloud platform deletes a part of target containers in the process according to the received control instruction; and after the test is finished, the cloud platform deletes all the target containers according to the instruction and releases the resources of the cloud platform.
In one example, a user accesses 10 ten thousand simulation clients at a time to start a test according to the capability of a server, in order to know the maximum bearing limit of the server, the number of the connected clients is increased in a stepwise increasing manner in the test process, for example, the number of the clients is 10 ten thousand, 5 ten thousand, or 2 ten thousand, when the number of the clients is increased to 30 ten thousand in a stepwise increasing manner, the test result displayed in the webpage is abnormal, and if the number of the clients which fail to be tested is displayed, the number of the clients exceeds the critical pressure point of the server, at this time, the user can issue a control instruction for reducing the test scale, delete 3 ten thousand simulation clients, check the log result again, and so on find the critical pressure point of the server. And when the test is finished, the Kubernets delete all the target containers according to the instruction, and resources of the cloud platform are released to share other test services for testing.
In the actual test service, the connection requests are evenly distributed in a certain time period through a random algorithm in the test program, for example, the heartbeat of MQTT is 2 times/min, the requests of the client side are evenly distributed in 2 minutes, the alternation of wave crests and wave troughs is avoided, so that the real scene is met, and the limit capacity of the server is tested to the maximum extent.
Step 206: and receiving a monitoring instruction, acquiring the performance indexes of the target containers in the test process according to the monitoring instruction, and converting the performance indexes of the target containers into icon data according to a preset icon template.
Specifically, the container performance indicators include: CPU, memory and network I/O resource consumption. In implementation, a monitoring system is deployed through an declarative yaml file, a target container to be monitored is informed to the monitoring system in a declaration, performance indexes of the target container are collected by using Grafana, icon data are generated through processing and visually displayed, and as shown in FIG. 4, resource consumption of a CPU, a memory and a network I/O of each Pod is displayed on an interface. The method can accurately observe the resource consumption of the test script or program, thereby promoting the iteration of the test script or program to improve the quality of the test script or program.
The steps of the above methods are divided for clarity, and the implementation may be combined into one step or split some steps, and the steps are divided into multiple steps, so long as the same logical relationship is included, which are all within the protection scope of the present patent; it is within the scope of the patent to add insignificant modifications to the algorithms or processes or to introduce insignificant design changes to the core design without changing the algorithms or processes.
Compared with the traditional test mode, the second embodiment of the invention realizes one-key deployment of the test program, and can perform one-key capacity expansion or capacity reduction processing according to the test requirement and the idle resources of the server after the performance test, thereby improving the utilization rate and the test efficiency of the hardware resources of the server; in addition, when the test requirement is changed, only the version number of the container needs to be correspondingly modified, so that the test flow is further simplified; in addition, besides visually displaying the test logs, the performance of each server is visually displayed through a chart in the test process, so that the quality of a test script or a program is promoted.
The third embodiment of the present invention relates to an MQTT server performance testing system, as shown in fig. 5, including: a warehousing module 301, a container deployment module 302, a task execution module 303, and a result generation module 304.
Specifically, the warehousing module 304 is configured to receive and store a test file and a test requirement, where the test requirement defines a test scale for running the test file; a container deployment module 302, configured to deploy, according to the test file, a plurality of target containers for executing the test file on a preset cloud platform; the task execution module 303: the system comprises a test process generation module, a test module and a test module, wherein the test process generation module is used for selecting at least one target container in a plurality of target containers according to a test requirement to generate a test process; the result generating module 304 is configured to perform data integration on the test result of the test process according to a preset data template to generate a test result.
In an example, the container deployment module 302 is further configured to receive a control instruction for reducing the test scale, and delete a corresponding number of target containers in the test process according to the control instruction.
In an example, the test file received in the warehousing module 301 includes a configuration file, and the container deployment module 302 deploys a plurality of target containers for executing the test file on the cloud platform according to the configuration file and generates version numbers of the target containers. When the test file needs to be replaced or the server performance test is carried out again after the test file is modified, the version of the target container only needs to be replaced correspondingly. The result generation module 304 collects log information generated by each target container in the test process; extracting test data in each log information according to a preset data template; and integrating the test data in the log information according to the number of the corresponding target container to generate a test result.
In an example, as shown in fig. 6, the apparatus further includes a monitoring module 305, configured to receive a monitoring instruction, and collect a performance index of a target container in a test process according to the monitoring instruction, where the container performance index includes: CPU, memory and network I/O resource consumption.
It should be understood that this embodiment is a system example corresponding to the first embodiment, and may be implemented in cooperation with the first embodiment. The related technical details mentioned in the first embodiment are still valid in this embodiment, and are not described herein again in order to reduce repetition. Accordingly, the related-art details mentioned in the present embodiment can also be applied to the first embodiment.
It should be noted that each module referred to in this embodiment is a logical module, and in practical applications, one logical unit may be one physical unit, may be a part of one physical unit, and may be implemented by a combination of multiple physical units. In addition, in order to highlight the innovative part of the present invention, elements that are not so closely related to solving the technical problems proposed by the present invention are not introduced in the present embodiment, but this does not indicate that other elements are not present in the present embodiment.
A fifth embodiment of the invention is directed to a computer apparatus, as shown in FIG. 7, comprising at least one processor 402; and, a memory 401 communicatively coupled to the at least one processor; the memory 401 stores instructions executable by the at least one processor 401, and the instructions are executed by the at least one processor 401, so that the at least one processor 401 can execute the MQTT server performance testing method according to the first embodiment or the second embodiment of the present invention.
Where the memory 402 and the processor 401 are coupled by a bus, which may include any number of interconnected buses and bridges that couple one or more of the various circuits of the processor 401 and the memory 402 together. The bus may also connect various other circuits such as peripherals, voltage regulators, power management circuits, and the like, which are well known in the art, and therefore, will not be described any further herein. A bus interface provides an interface between the bus and the transceiver. The transceiver may be one element or a plurality of elements, such as a plurality of receivers and transmitters, providing a means for communicating with various other apparatus over a transmission medium. The data processed by the processor is transmitted over a wireless medium via an antenna, which further receives the data and transmits the data to the processor.
The processor is responsible for managing the bus and general processing and may also provide various functions including timing, peripheral interfaces, voltage regulation, power management, and other control functions. And the memory may be used to store data used by the processor in performing operations.
A sixth embodiment of the present invention relates to a computer-readable storage medium storing a computer program. The computer program realizes the above-described method embodiments when executed by a processor.
That is, as can be understood by those skilled in the art, all or part of the steps in the method according to the above embodiments may be implemented by a program instructing related hardware, where the program is stored in a storage medium and includes several instructions to enable a device (which may be a single chip, a chip, or the like) or a processor (processor) to execute all or part of the steps in the method according to the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-only Memory (ROM), a Random Access Memory (RAM), a magnetic disk or an optical disk, and other various media capable of storing program codes.
It will be understood by those of ordinary skill in the art that the foregoing embodiments are specific examples for carrying out the invention, and that various changes in form and details may be made therein without departing from the spirit and scope of the invention in practice.

Claims (10)

1. A method for testing MQTT server performance is characterized by comprising the following steps:
receiving a test file to be tested and a test requirement, wherein the test requirement defines a test scale for operating the test file;
deploying a plurality of target containers for executing the test files on a preset cloud platform according to the test files;
selecting at least one target container in the multiple target containers according to the test requirement to generate a test process;
and performing data integration on the test result of the test process according to a preset data template to generate a test result.
2. The MQTT server performance testing method according to claim 1, wherein the test file comprises a configuration file, and deploying a plurality of target containers for executing the test file on a preset cloud platform according to the test file comprises:
deploying a plurality of target containers for executing the test files on the cloud platform according to the configuration files and generating version numbers of the target containers.
3. The MQTT server performance testing method of claim 1, wherein after performing data integration on the test result of the test process according to a preset data template to generate a test result, the method further comprises:
receiving a control instruction for reducing the test scale;
and deleting the corresponding number of target containers in the test process according to the control instruction.
4. The MQTT server performance testing method of claim 1, wherein the performing data integration on the test result of the test process according to a preset data template to generate the test result comprises:
collecting log information generated by each target container in the test process;
extracting test data in each log information according to a preset data template;
and integrating the test data in the log information according to the number of the corresponding target container to generate a test result.
5. The MQTT server performance testing method according to claim 1, further comprising:
receiving a monitoring instruction;
collecting performance indexes of the target container in the test process according to the monitoring instruction, wherein the container performance indexes comprise: CPU, memory and network I/O resource consumption;
and converting the performance indexes of the target containers into chart data according to a preset icon template.
6. An MQTT server performance testing system, characterized by comprising:
the storage module is used for receiving and storing a test file and a test requirement, wherein the test requirement limits the test scale for operating the test file;
the container deployment module is used for deploying a plurality of target containers for executing the test files on a preset cloud platform according to the test files;
a task execution module: the system comprises a test module, a test module and a control module, wherein the test module is used for selecting at least one target container in a plurality of target containers according to the test requirement to generate a test process;
and the result generation module is used for carrying out data integration on the test result of the test process according to a preset data template to generate a test result.
7. The MQTT server performance testing system of claim 6, wherein the container deployment module is further configured to receive a control instruction for reducing the test scale, and delete a corresponding number of target containers in the testing process according to the control instruction.
8. The MQTT server performance testing system of claim 6, further comprising a monitoring module;
the monitoring module is configured to receive a monitoring instruction, and collect a performance index of the target container in the test process according to the monitoring instruction, where the performance index of the container includes: CPU, memory and network I/O resource consumption.
9. A computer device, comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the MQTT server performance testing method of any of claims 1 to 5.
10. A computer-readable storage medium storing a computer program, wherein the computer program, when executed by a processor, implements the MQTT server performance testing method of any of claims 1 to 5.
CN201911100308.2A 2019-11-12 2019-11-12 MQTT server performance testing method, system, computer equipment and storage medium Pending CN111124850A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201911100308.2A CN111124850A (en) 2019-11-12 2019-11-12 MQTT server performance testing method, system, computer equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201911100308.2A CN111124850A (en) 2019-11-12 2019-11-12 MQTT server performance testing method, system, computer equipment and storage medium

Publications (1)

Publication Number Publication Date
CN111124850A true CN111124850A (en) 2020-05-08

Family

ID=70495218

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201911100308.2A Pending CN111124850A (en) 2019-11-12 2019-11-12 MQTT server performance testing method, system, computer equipment and storage medium

Country Status (1)

Country Link
CN (1) CN111124850A (en)

Cited By (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111639032A (en) * 2020-06-02 2020-09-08 百度在线网络技术(北京)有限公司 Method and apparatus for testing applications
CN111682970A (en) * 2020-06-11 2020-09-18 湖南华诺科技有限公司 System and method for rapidly expanding and contracting capacity of content networking based on containerization
CN111913861A (en) * 2020-07-31 2020-11-10 中国建设银行股份有限公司 Performance test method, device, equipment and medium of Internet of things system
CN112039722A (en) * 2020-08-12 2020-12-04 中国银联股份有限公司 MQTT protocol simulation method and simulation equipment
CN112054941A (en) * 2020-09-07 2020-12-08 平安科技(深圳)有限公司 Automatic testing method, device and equipment for private domain name and storage medium
CN112231223A (en) * 2020-10-27 2021-01-15 南京林洋电力科技有限公司 Distributed automatic software testing method and system based on MQTT
CN112905454A (en) * 2021-02-04 2021-06-04 郑州信大捷安信息技术股份有限公司 MQTT service testing system and method
CN112965882A (en) * 2021-03-30 2021-06-15 北京三快在线科技有限公司 Data fault analysis method and device
CN113064827A (en) * 2021-04-12 2021-07-02 京东数科海益信息科技有限公司 Test platform deployment method, device, equipment and storage medium
CN113079061A (en) * 2021-03-24 2021-07-06 广东海聊科技有限公司 Internet of things performance testing method and system
CN113094266A (en) * 2021-04-06 2021-07-09 中国工商银行股份有限公司 Fault testing method, platform and equipment for container database
CN113297072A (en) * 2021-05-17 2021-08-24 阿里巴巴新加坡控股有限公司 Container testing method and device
CN113300900A (en) * 2020-06-28 2021-08-24 阿里巴巴集团控股有限公司 Method, device and system for testing service on cloud and method and device for testing container
CN113505073A (en) * 2021-07-15 2021-10-15 北京金山云网络技术有限公司 Database performance test method, device, equipment and medium
CN114201413A (en) * 2022-02-18 2022-03-18 苏州浪潮智能科技有限公司 Automatic testing method and system and electronic equipment
CN116303067A (en) * 2023-03-24 2023-06-23 安超云软件有限公司 Testing method, device, equipment and medium based on cloud testing platform
CN116781564A (en) * 2023-07-26 2023-09-19 上海道客网络科技有限公司 Network detection method and system for container cloud platform

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN108427641A (en) * 2018-01-29 2018-08-21 中国互联网络信息中心 A kind of multi-task scheduling automated testing method and system based on Docker containers
US20190065292A1 (en) * 2017-08-28 2019-02-28 General Electric Company Software container messaging mechanism
CN110162471A (en) * 2019-04-28 2019-08-23 中国工商银行股份有限公司 A kind of method for testing pressure and system based on container cloud

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20190065292A1 (en) * 2017-08-28 2019-02-28 General Electric Company Software container messaging mechanism
CN108427641A (en) * 2018-01-29 2018-08-21 中国互联网络信息中心 A kind of multi-task scheduling automated testing method and system based on Docker containers
CN110162471A (en) * 2019-04-28 2019-08-23 中国工商银行股份有限公司 A kind of method for testing pressure and system based on container cloud

Cited By (24)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111639032A (en) * 2020-06-02 2020-09-08 百度在线网络技术(北京)有限公司 Method and apparatus for testing applications
CN111639032B (en) * 2020-06-02 2023-08-01 百度在线网络技术(北京)有限公司 Method and apparatus for testing applications
CN111682970A (en) * 2020-06-11 2020-09-18 湖南华诺科技有限公司 System and method for rapidly expanding and contracting capacity of content networking based on containerization
CN113300900A (en) * 2020-06-28 2021-08-24 阿里巴巴集团控股有限公司 Method, device and system for testing service on cloud and method and device for testing container
CN111913861A (en) * 2020-07-31 2020-11-10 中国建设银行股份有限公司 Performance test method, device, equipment and medium of Internet of things system
CN112039722A (en) * 2020-08-12 2020-12-04 中国银联股份有限公司 MQTT protocol simulation method and simulation equipment
CN112039722B (en) * 2020-08-12 2022-07-08 中国银联股份有限公司 MQTT protocol simulation method and simulation equipment
CN112054941A (en) * 2020-09-07 2020-12-08 平安科技(深圳)有限公司 Automatic testing method, device and equipment for private domain name and storage medium
CN112054941B (en) * 2020-09-07 2023-03-24 平安科技(深圳)有限公司 Automatic testing method, device and equipment for private domain name and storage medium
CN112231223A (en) * 2020-10-27 2021-01-15 南京林洋电力科技有限公司 Distributed automatic software testing method and system based on MQTT
CN112905454A (en) * 2021-02-04 2021-06-04 郑州信大捷安信息技术股份有限公司 MQTT service testing system and method
CN112905454B (en) * 2021-02-04 2022-04-08 郑州信大捷安信息技术股份有限公司 MQTT service testing system and method
CN113079061A (en) * 2021-03-24 2021-07-06 广东海聊科技有限公司 Internet of things performance testing method and system
CN112965882A (en) * 2021-03-30 2021-06-15 北京三快在线科技有限公司 Data fault analysis method and device
CN113094266A (en) * 2021-04-06 2021-07-09 中国工商银行股份有限公司 Fault testing method, platform and equipment for container database
CN113064827A (en) * 2021-04-12 2021-07-02 京东数科海益信息科技有限公司 Test platform deployment method, device, equipment and storage medium
CN113297072A (en) * 2021-05-17 2021-08-24 阿里巴巴新加坡控股有限公司 Container testing method and device
CN113297072B (en) * 2021-05-17 2023-11-03 阿里巴巴新加坡控股有限公司 Container testing method and device
CN113505073A (en) * 2021-07-15 2021-10-15 北京金山云网络技术有限公司 Database performance test method, device, equipment and medium
CN114201413A (en) * 2022-02-18 2022-03-18 苏州浪潮智能科技有限公司 Automatic testing method and system and electronic equipment
CN116303067A (en) * 2023-03-24 2023-06-23 安超云软件有限公司 Testing method, device, equipment and medium based on cloud testing platform
CN116303067B (en) * 2023-03-24 2024-03-22 安超云软件有限公司 Testing method, device, equipment and medium based on cloud testing platform
CN116781564A (en) * 2023-07-26 2023-09-19 上海道客网络科技有限公司 Network detection method and system for container cloud platform
CN116781564B (en) * 2023-07-26 2024-02-13 上海道客网络科技有限公司 Network detection method, system, medium and electronic equipment of container cloud platform

Similar Documents

Publication Publication Date Title
CN111124850A (en) MQTT server performance testing method, system, computer equipment and storage medium
CN109302522B (en) Test method, test device, computer system, and computer medium
EP3447642B1 (en) System and method for predicting application performance for large data size on big data cluster
CN108959059B (en) Test method and test platform
EP2572294B1 (en) System and method for sql performance assurance services
US7315807B1 (en) System and methods for storage area network simulation
CN112989330B (en) Container intrusion detection method, device, electronic equipment and storage medium
CN110750458A (en) Big data platform testing method and device, readable storage medium and electronic equipment
CN109901985B (en) Distributed test apparatus and method, storage medium, and electronic device
CN107404417A (en) A kind of processing method of monitoring data, processing unit and processing system
CN105204986A (en) Automated product testing method, server and mobile equipment
CN110659202A (en) Client automatic testing method and device
CN112241360A (en) Test case generation method, device, equipment and storage medium
CN106708727B (en) Distributed virus characteristic sample verification method and system
CN104735063B (en) A kind of safe evaluating method for cloud infrastructure
CN102014163A (en) Cloud storage test method and system based on transaction driving
CN104636250A (en) Cloud automatic test system and method
CN111859139A (en) Application program recommendation method and device, computing equipment and medium
RU2532714C2 (en) Method of acquiring data when evaluating network resources and apparatus therefor
US20220182290A1 (en) Status sharing in a resilience framework
CN109634792A (en) A kind of server hardware test platform system based on cloud computing
CN114385498A (en) Performance test method, system, computer equipment and readable storage medium
CN111694752A (en) Application testing method, electronic device and storage medium
CN109324802B (en) Method and device for configuring server
CN113094266A (en) Fault testing method, platform and equipment for container database

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination