Video service pressure test method and system and electronic equipment
Through the combination of virtual servers and simulated video stream generation modules, resource configuration is dynamically adjusted and performance is monitored in real time, which solves the high cost of stress testing of video services and difficult problem positioning in the existing technology, and realizes efficient video service performance testing and optimization .
Patent Information
- Application Number
- CN202411440366.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-10-15
- Publication Date
- 2025-01-10
AI Technical Summary
In the prior art, using physical servers and cameras to conduct stress testing of video services leads to high costs, complex testing environments and difficult problem location.
The virtual server and simulated video stream generation module are used for stress testing, and the resource configuration is dynamically adjusted through the virtualization resource manager, combining real-time monitoring and analysis tools to identify performance bottlenecks and optimize service performance.
Significantly reduce hardware procurement and maintenance costs, improve test agility and response speed, simplify problem positioning, and ensure the stability and reliability of video services under different load conditions.
Smart Images

Figure CN119299661A_ABST
Abstract
Description
Technical Field
[0001] The present application belongs to the field of testing technology, and specifically relates to a video service stress testing method, system and electronic equipment. Background Art
[0002] With the development of video surveillance technology, the application scenarios of monitoring platforms are becoming increasingly complex. Not only do they need to monitor multiple locations at the same time, but they also need to be played on multiple terminals. In this case, the parameters such as bitrate and resolution of each camera are not uniform, and the number of target terminals for concurrent streaming is not fixed. When multiple target terminals simultaneously pull video streams from multiple cameras, the performance of the media service becomes an important bottleneck. Therefore, it is particularly necessary to stress test the performance of the media service to provide a reasonable streaming solution and server configuration list to ensure that the platform can run stably in various complex scenarios.
[0003] Existing technical solutions usually involve preparing a large number of servers and cameras, building a complex network environment for performance testing, and adjusting the number of servers and cameras according to different test requirements. However, using a large number of physical servers and cameras for stress testing not only has high equipment procurement costs, but also quite expensive maintenance costs. Building a complex network environment for testing is time-consuming, and once the test plan changes, the environment needs to be readjusted, which increases the test cycle. In a test environment built with physical equipment, when a problem occurs, it is difficult to quickly determine the root cause of the problem, resulting in a long time to locate the problem. Summary of the invention
[0004] The present application provides a video service stress testing method to solve the technical problems of high cost, complex testing environment and difficulty in problem location caused by using actual physical servers and cameras for stress testing in the prior art.
[0005] The technical solution adopted in this application is:
[0006] The present application provides a video service stress testing method, including:
[0007] Determine test objectives and test requirements, and configure and adjust virtual server resources according to test requirements;
[0008] Configure the video stream generation module to simulate the generation of video streams, set device registration information, access protocol, serial number rules, and reconnection mechanism;
[0009] Starting the video stream processing module to receive and process the video stream and perform a performance test;
[0010] Monitor the server's performance data in real time and generate analysis reports;
[0011] The performance bottleneck is identified based on the performance data and analysis report obtained through monitoring, and the test parameters are adjusted or the service performance is optimized, and the test is iterated in a loop until the predetermined performance requirements are met.
[0012] A video service stress testing method provided by the present application also includes the following additional technical features: the test objectives and test requirements are determined, and virtual server resources are configured and adjusted according to the test requirements, specifically:
[0013] Develop a test plan based on the expected workload, key performance indicators and specific needs of the video server;
[0014] Create virtual server instances in the virtualization resource manager and accurately configure the required resources for each instance, including the allocation of CPU, memory size, and network bandwidth settings;
[0015] Based on the problems found during the test or to verify the performance under different configurations, dynamically adjust the CPU quota, memory limit and bandwidth control of the network interface through the virtualization resource manager.
[0016] According to an embodiment of the present application, the configuration video stream generation module is used to simulate the generation of the video stream, and the device registration information, access protocol, serial number rule and reconnection mechanism are set, specifically:
[0017] Set key parameters through the configuration file of the video stream generation module.
[0018] Clearly specify the IP address and port number of the simulated device registration and online server;
[0019] Define the protocol used when simulating device access, and simulate different protocols and device access from different manufacturers;
[0020] Set up rules to generate device serial numbers, ensuring that each simulated device has a unique and easily traceable identifier;
[0021] Specify the device online policy, including the number of devices online for the first time and the number of devices allowed to go online per second;
[0022] Define the video stream bitrate, resolution, whether to include audio, and streaming duration parameters to simulate video streaming scenarios under different network conditions;
[0023] Set the device offline frequency and reconnection mechanism parameters to simulate the situation where the device frequently goes online and offline in an unstable network environment, including the device offline period, the interval time between reconnection attempts, and the maximum number of reconnection attempts.
[0024] According to an embodiment of the present application, the starting video stream processing module receives and processes the video stream and performs a performance test, specifically:
[0025] The address and port of the streaming server are defined in the configuration file of the video stream processing module so that the processing module can correctly connect to the server, configure the streaming protocol to ensure smooth transmission and compatibility of the video stream, ensure that the streaming device serial number rule is consistent with the video stream generation module, and configure the number of devices allowed to stream simultaneously, so as to simulate the load situation in actual applications;
[0026] Define the device link strategy and video stream playback mode in the configuration file, including the number of devices to be linked for the first time and the rule for increasing the number of device links, to simulate the dynamic change of the number of users and select the video stream playback mode;
[0027] Set the streaming duration in the configuration file according to test requirements to cover different scenarios from short-term viewing to long-term monitoring;
[0028] Use JMeter to record the key performance indicators of server throughput and latency during the simulated device registration and onboarding process.
[0029] According to an embodiment of the present application, the real-time monitoring of the performance data of the server and the generation of the analysis report are specifically as follows:
[0030] Deploy Prometheus and Xshell tools, and use Prometheus to monitor various data of the server in the process of pulling streams in real time, including but not limited to CPU utilization, memory usage, network traffic, and load; use Xshell to monitor the data of various services on the server in real time;
[0031] Generate analysis reports based on the collected data to compile and analyze the test results.
[0032] According to an embodiment of the present application, the performance bottleneck is identified based on the performance data and the analysis report obtained through monitoring, and the test parameters are adjusted or the service performance is optimized, and the test is iterated in a loop until the predetermined performance requirements are met, specifically:
[0033] Through the analysis report, analyze and identify the overall performance bottleneck of the server and the performance bottleneck of individual services, including checking CPU utilization, memory usage, network traffic and load key indicators;
[0034] According to the analysis results in the analysis report, adjust the configuration of virtualized resources and optimize service performance, including adjusting service configuration parameters and improving code logic;
[0035] Conduct new test rounds until the test results meet the predetermined performance requirements, including reconfiguring virtualized resources, performing performance tests again, and continuously monitoring performance data;
[0036] After each iteration, analyze the test report again to confirm whether the performance bottlenecks found previously have been resolved. If there are still performance indicators that do not meet the standards, you need to continue to adjust parameters or optimize services until all performance indicators meet expectations.
[0037] A video service stress testing system, comprising:
[0038] Video stream generation module, used to simulate and generate a large number of video streaming requests;
[0039] The video stream processing module is responsible for encoding, decoding and forwarding operations of video streams. It allows key parameters to be defined through configuration files, such as the total number of streams pulled, the frequency of streams pulled per second, the incremental strategy, the reconnection mechanism and the concurrent processing capability.
[0040] Performance testing module, used to simulate user preview and playback behaviors and test key performance indicators of video services;
[0041] Monitoring and data analysis module, which is used to deploy Prometheus and Xshell tools to monitor video service performance in real time and realize data visualization;
[0042] The virtualization resource manager is used to use Docker containerization technology to achieve refined dynamic management of virtualized resources, including but not limited to quota adjustment of CPU resources, dynamic scaling of memory limits, and bandwidth control of network interfaces. Kubernetes is used as the container orchestration engine to achieve efficient scheduling and elastic scaling of resources, ensuring high availability and performance optimization of services.
[0043] According to an embodiment of the present application, the video stream processing module is connected to the video stream generating module by configuring the address and port of the stream pulling server.
[0044] According to one embodiment of the present application, the performance testing module is connected to the video stream processing module, and the monitoring and data analysis module and the virtualization resource manager are connected to other modules.
[0045] An electronic device comprises a memory, a processor and a program stored in the memory and executable on the processor, wherein the processor implements steps in a video service stress testing method when executing the program.
[0046] Due to the adoption of the above technical solution, the beneficial effects achieved by this application are as follows:
[0047] 1. This application significantly reduces the cost of hardware procurement and maintenance by using virtual servers instead of actual physical devices for performance testing. Virtualization technology allows multiple virtual instances to run on the same physical hardware, thereby reducing the need for expensive hardware resources. In addition, virtual servers can dynamically adjust resources according to test requirements, avoiding waste caused by idle resources. The virtualized environment makes the construction of the test environment more flexible. Testers can quickly create, modify, and delete virtual server instances as needed without the need for cumbersome physical device configuration. This means that test plans can be more easily adjusted according to changes in requirements, improving the agility and responsiveness of the test.
[0048] 2. This application uses centralized monitoring tools (such as Prometheus and Xshell) to monitor the performance data of the server in real time and generate detailed analysis reports. The data and visual interface provided by these tools help testers quickly locate the problem and reduce the time for problem diagnosis. At the same time, the virtualization environment itself also provides better debugging methods, making problem troubleshooting easier.
[0049] 3. The video stream generation module allows simulating the access conditions of different devices, including device registration information, access protocols, serial number rules, and reconnection mechanisms. This allows the test to cover a variety of actual application scenarios and ensure that the video service can work properly under different conditions. By adjusting the parameters of the video stream, such as bit rate and resolution, testers can simulate different network conditions, further enhancing the comprehensiveness and accuracy of the test.
[0050] 4. Through continuous performance testing and analysis, this application can continuously identify performance bottlenecks and take targeted measures for optimization. Whether it is adjusting the resource configuration of the virtual server or optimizing the logic and code of the service itself, it can be done based on actual test results, thereby ensuring that the performance of the video service is continuously improved.
[0051] 5. The iterative testing process ensures the stability and reliability of the video service under different load conditions. Through continuous monitoring and analysis of test results, potential problems can be discovered and resolved in a timely manner, thus ensuring the service quality for end users. BRIEF DESCRIPTION OF THE DRAWINGS
[0052] The drawings described herein are used to provide a further understanding of the present application and constitute a part of the present application. The illustrative embodiments of the present application and their descriptions are used to explain the present application and do not constitute an improper limitation on the present application. In the drawings:
[0053] Figure 1 A flowchart of a video service stress testing method provided in an embodiment of the present application. DETAILED DESCRIPTION
[0054] In order to more clearly illustrate the overall concept of the present application, a detailed description is given below in an illustrative manner in conjunction with the accompanying drawings.
[0055] In the following description, many specific details are set forth to facilitate a full understanding of the present application. However, the present application may also be implemented in other ways different from those described herein. Therefore, the protection scope of the present application is not limited by the specific embodiments disclosed below. It should be noted that the embodiments of the present application and the features in each embodiment may be combined with each other without conflict.
[0056] In the present application, unless otherwise clearly specified and limited, a first feature "above" or "below" a second feature may be that the first and second features are in direct contact, or the first and second features are in indirect contact through an intermediate medium. In the description of this specification, the description with reference to the terms "one embodiment", "some embodiments", "example", "specific example", or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present application. In this specification, the schematic representation of the above terms does not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described may be combined in an appropriate manner in any one or more embodiments or examples.
[0057] Example 1
[0058] like Figure 1 As shown, a video service stress testing method includes:
[0059] S100: Determine test objectives and test requirements, and configure and adjust virtual server resources according to the test requirements.
[0060] Specifically, first, clarify the expected load, key performance indicators and specific needs of the video server in different scenarios, and develop a detailed test plan based on this information. The test plan should cover key parameters such as the bit rate and resolution of the video stream to ensure that the test can accurately reflect the performance of the video server in actual work.
[0061] Next, according to the above test plan, create a virtual server instance in the virtualization resource manager and accurately configure the resources of each virtual server instance. Specifically, it includes but is not limited to the following resource allocations:
[0062] CPU resources: Allocate sufficient CPU resources to each virtual server instance based on test requirements. This involves setting an appropriate CPU quota for each virtual server to ensure that the server has sufficient computing power to process video streams when simulating high-concurrency scenarios.
[0063] Memory resources: Equally important is the configuration of memory resources. When creating a virtual server, you need to assign an appropriate amount of memory to each instance to meet the needs of data storage and exchange during video streaming.
[0064] Network bandwidth: Considering the reliance of video streaming on network resources, it is also necessary to properly plan the network bandwidth of the virtual server. This involves configuring the appropriate network interface for the virtual server and setting appropriate bandwidth control to simulate different network environments and conditions.
[0065] Through the above steps, it is ensured that the virtual server can accurately simulate various resource constraints that may be encountered in the real environment, providing a solid foundation for subsequent video stream generation, processing and performance testing. At the same time, these virtual server resources can be adjusted dynamically, which means that during the test process, the CPU quota, memory limit and network interface bandwidth control can be adjusted at any time according to the problems found or to verify the performance under different configurations, so as to achieve a comprehensive evaluation of video service performance.
[0066] Such preparation is crucial because only by properly configuring virtual server resources can we effectively simulate the load of video services in actual applications, accurately evaluate their performance, and make optimization adjustments accordingly.
[0067] For example, first, the test objectives need to be clearly defined. For example, suppose you need to test the performance of a video surveillance platform when the number of concurrent users reaches 1,000. Then the test objective is to verify whether the system can run stably under high concurrency and ensure that the transmission delay of the video stream is below a certain threshold.
[0068] Next, we need to refine the test requirements. For example, we need to test the performance of video streams under different network conditions (such as ideal network environment, ordinary home broadband environment, weak network environment, etc.). This means that we need to simulate video stream transmission under different network conditions to test the robustness and response speed of the video surveillance platform.
[0069] Then, according to the above test objectives and requirements, create a virtual server instance in the virtualization resource manager and configure the corresponding resources for it. For example, assuming that each virtual user is expected to consume approximately 0.1 CPU cores and 100MB of memory, then for 1,000 concurrent users, at least a virtual server instance with 10 CPU cores and 10GB of memory needs to be configured. In addition, the impact of network bandwidth must also be considered. If the network traffic generated by each user is expected to be 1Mbps, then the total bandwidth requirement is at least 1Gbps.
[0070] After creating a virtual server instance, you need to further adjust resource configuration to meet changes in test requirements. For example, if you find that the system's CPU utilization is close to 100% during the test, you can adjust the virtual server's CPU quota and add more CPU cores to relieve the pressure. Similarly, if you find that memory usage is close to the upper limit, you can also dynamically increase memory capacity. In addition, if the test shows that network traffic exceeds expectations, you also need to increase the bandwidth configuration of the network interface accordingly.
[0071] Through such steps, it can be ensured that the configuration of virtual server resources meets the test requirements and can be adjusted in time according to problems found during the test to ensure the accuracy and reliability of the test results.
[0072] Furthermore, real network conditions can be simulated: in addition to configuring resources such as CPU, memory, and bandwidth, network simulation tools can be used to simulate real network conditions such as latency and packet loss rate to more accurately reflect the impact of the actual network environment on video service performance.
[0073] Furthermore, multi-dimensional performance testing can be performed: when configuring virtual server resources, not only should we focus on single performance indicators (such as CPU utilization, memory usage, etc.), but we should also comprehensively consider performance tests in multiple dimensions, such as disk I / O performance, storage space usage, etc., to comprehensively evaluate the performance of the video service.
[0074] Furthermore, security testing can also be considered: when configuring virtual server resources, the needs of security testing should also be considered, such as simulating scenarios such as illegal access and malicious attacks to verify the security protection capabilities of the video service.
[0075] Furthermore, geographical distribution can be simulated: if the video service needs to provide services worldwide, then when configuring virtual server resources, you can also consider simulating user access in different geographical locations to evaluate the performance of the service worldwide.
[0076] S200, configuring a video stream generation module to simulate the generation of a video stream, and setting device registration information, access protocol, serial number rules, and a reconnection mechanism.
[0077] Specifically, first, you need to start the video stream generation module and set a series of key parameters through the configuration file to ensure that the device can be successfully registered and efficiently connected to the system. These parameters include:
[0078] Device registration and onboarding server information: Clearly specify the IP address and port number of the device registration and onboarding server to ensure that the device can accurately connect to the server.
[0079] Device access protocol: defines the protocol used when the device is accessed, simulating the access of devices with different protocols and different manufacturers. For example, you can set the device to access the system using RTSP, RTMP or other proprietary protocols.
[0080] Device serial number generation rules: Set device serial number generation rules to ensure that each device has a unique and easy-to-track identifier. This helps to distinguish different devices and the video streams they generate during testing.
[0081] Device online rules: Specifies the strategy for device online, including the number of devices online for the first time and the number of devices online per second. These strategies help simulate the load conditions when the system starts and simulate the device access rate in the real world.
[0082] Configure video stream parameters: Define the various parameters of the simulated video stream in the configuration file to ensure that various streaming scenarios and conditions can be accurately simulated. For example, parameters such as video bitrate settings, resolution configuration, whether to include audio options, and streaming duration all need to be carefully set.
[0083] Configure the device's reconnection mechanism: Set the device's offline frequency and reconnection mechanism parameters in the configuration file to simulate the situation where the device frequently goes online and offline in an unstable network environment. This includes the device's simulated offline cycle (such as setting the device to automatically go offline after a certain time interval to simulate a disconnection in a weak network environment), the interval between reconnection attempts, and the maximum number of reconnections.
[0084] Through these configurations, the video stream generation module can efficiently simulate and generate a large number of video streaming requests. Users can customize key parameters such as video bitrate and resolution according to specific needs, and then generate video streams that meet specific needs. These simulated video streams will be used to test the performance of video services under different network conditions.
[0085] For example, device registration and online server information: Assuming that the IP address of the video server to be tested is 192.168.1.100 and the port number is 8080, then in the configuration file of the video stream generation module, we need to set server_ip = 192.168.1.100, server_port = 8080 to ensure that the simulated device can accurately connect to the server.
[0086] Device access protocol: The protocol used when simulating device access, for example, define the RTSP protocol when defining device access. In the configuration file, you can set protocol = rtsp to specify the protocol used when simulating device access. If you need to test different protocols and device access from different manufacturers, you can set different protocol types respectively.
[0087] Device serial number generation rules: Set the device serial number generation rules to ensure that each device has a unique and easy-to-track identifier. For example, you can set the device serial number to be a prefix plus a random number, such as device_####, where #### represents a four-digit random number, which ensures that each device has a unique serial number.
[0088] Device online rules: Specifies the strategy for device online, including the number of devices online for the first time and the number of devices online per second. For example, the number of devices online for the first time is set to initial_count = 50, that is, when the system starts or the test starts, the number of devices allowed to go online is 50. The number of devices online per second is set to device_per_second = 5 to limit the number of devices online per unit time, simulating the device access rate in the real world.
[0089] Configure video stream parameters: Define various parameters for simulating video streams. For example, set the video bitrate to bitrate = 1024kbps to adapt to different network environments and quality requirements. Define the resolution of the video stream to resolution = 1280x720 to simulate video sources of different resolutions. Choose whether to add audio to the video stream, such as audio_option = true, to simulate scenarios with audio or pure video streams. Define the push duration of the video stream to stream_duration = 3600s to simulate different pull duration requirements such as long-term monitoring.
[0090] Configure the device's reconnection mechanism: Set the device's offline frequency and reconnection mechanism parameters. For example, you can set the device to automatically go offline after a certain time interval, such as offline_interval = 60s, to simulate disconnection in a weak network environment. Define the device's reconnection attempt strategy, such as reconnect_interval = 10s, which means the device attempts to reconnect for 10 seconds each time, and max_reconnect_attempts = 5, which means the maximum number of reconnections for the device is 5.
[0091] Through these configurations, the video stream generation module can efficiently simulate and generate a large number of video streaming requests. Users can customize key parameters such as video bit rate and resolution according to specific needs, and then generate video streams that meet specific needs, providing a reliable data source for subsequent video service performance testing.
[0092] Furthermore, it can also support multiple protocols: in addition to the common RTSP and RTMP protocols, it can also support other special protocols and even custom protocols. By adding support for these protocols in the configuration file, various device access scenarios can be simulated more widely.
[0093] Furthermore, the serial number rules can be diversified: in addition to simple combinations of numbers or letters, more complex serial number generation rules can be introduced, such as dynamically generating serial numbers by combining timestamps, geographic location information, etc., to adapt to more complex scenario requirements.
[0094] Furthermore, the device behavior can be simulated: in addition to the reconnection mechanism, other device behaviors can also be simulated, such as the frequency of sending heartbeat packets, the recovery strategy after video stream interruption, etc., to further enrich the device behavior model and make it closer to actual usage.
[0095] Furthermore, you can also trigger custom events: add configuration items to support the triggering of custom events, such as simulating a device to automatically go offline or produce abnormal behavior at a specific time point, so that you can test the system's processing capabilities under abnormal circumstances.
[0096] S300: Start a video stream processing module to receive and process the video stream, and perform a performance test.
[0097] Specifically, configure the parameters of the video stream processing module: First, in the configuration file of the video stream processing module, you need to configure the address and port of the streaming server to ensure that the video stream processing module can accurately connect to the video stream server. Secondly, you need to configure the streaming protocol, such as RTSP, RTMP or private protocol, to ensure smooth transmission and compatibility of the video stream. In addition, you also need to configure the device serial number rules for streaming, and keep them consistent with the rules of the video stream generation module. Finally, configure the number of devices allowed to stream simultaneously to simulate the load conditions in actual applications and test the processing capacity and performance of the system.
[0098] Define the streaming mode: Define the device link strategy and video stream playback mode in the configuration file to ensure that the test environment can simulate the real usage scenario. The number of devices to be linked for the first time should be specified, which helps to simulate the load when the system starts. The device link increment rule also needs to be set to simulate the dynamic change of the number of users. The video stream playback mode selection provides two options: "real-time preview" or "recording playback", which will affect the data processing flow of the video stream processing module and the focus of performance testing.
[0099] Configure the streaming duration: Define the streaming duration in the configuration file based on test requirements to ensure that the test covers different scenarios from short viewing to long-term monitoring.
[0100] Record test data: Use the JMeter tool to record key performance indicators such as server throughput and latency during the simulated device registration and online process.
[0101] Through the above steps, the video stream processing module can receive and process video streams and conduct comprehensive tests on various performance indicators of video services. These steps ensure that the test environment can simulate real usage scenarios, thereby obtaining reliable performance test results.
[0102] For example, to configure the video stream processing module parameters:
[0103] Streaming server address and port: Assuming the IP address of the streaming server is 192.168.1.10 and the port number is 8080, you need to configure server_ip=192.168.1.10 and server_port=8080 in the configuration file of the video stream processing module to ensure that the video stream processing module can accurately connect to the server.
[0104] Streaming protocol: If the video stream is transmitted using the RTMP protocol, you need to set protocol = rtmp in the configuration file.
[0105] Device serial number rule: Assuming that the device serial number follows the device_##### format (where ##### represents 5 digits), the serial number rule should be set in the configuration file as device_serial=device_#####.
[0106] Number of streaming devices: Set the number of devices that are allowed to stream at the same time to max_concurrent_streams = 100 to simulate the load conditions in actual applications.
[0107] Define the pull mode:
[0108] Number of devices connected for the first time: Set the number of devices to establish the first connection when the system starts or the test begins to be initial_device_count = 20.
[0109] Device link increment rule: Set the number of device links added per second to increment_per_second=5 to simulate the dynamic change of the number of users.
[0110] Video stream playback mode: If you select the video stream playback mode as "live preview", you should set stream_mode = live_preview in the configuration file.
[0111] Configure the streaming duration:
[0112] Assuming that the test requirement requires the continuous streaming time to be duration = 3600 seconds (ie, 1 hour), the streaming duration should be set to stream_duration = 3600 seconds in the configuration file.
[0113] Record test data:
[0114] Use the JMeter tool to record key performance indicators such as server throughput and latency during the simulated device registration and launch process. For example, record the number of video streams processed per second, average latency, etc.
[0115] Through the above configuration, the video stream processing module can receive and process the video stream according to the set parameters and record the relevant performance test data. These specific configurations and test data records will help to deeply analyze the performance of the video service under different load conditions.
[0116] Furthermore, the streaming protocol configuration can be refined: in addition to common protocols such as RTMP and RTSP, more private protocols or emerging protocols such as WebRTC can be considered to be supported to meet the video streaming transmission requirements in different scenarios. By adding support for these protocols in the configuration file, the video stream processing module can be ensured to be compatible with various video streaming transmission protocols.
[0117] Furthermore, it is possible to simulate multiple video stream playback modes: in addition to the two basic video stream playback modes of "real-time preview" and "recorded playback", more playback modes can be added, such as delayed playback, fast forward / slow motion and other functions, so as to more comprehensively test the performance of the video stream processing module in different playback scenarios.
[0118] Furthermore, the number of streaming devices can be dynamically adjusted: During the test, a strategy can be designed to dynamically adjust the number of streaming devices, such as adding or reducing a certain number of devices at regular intervals to simulate fluctuations in the number of users in actual application scenarios, and further test the performance of the video stream processing module under different loads.
[0119] Furthermore, the streaming duration can be diversified: in addition to setting a fixed streaming duration, a random or dynamically changing streaming duration can be configured to simulate the uncertainty of the video stream and test the processing capability and stability of the video stream processing module under different streaming durations.
[0120] Furthermore, you can also add abnormal scenario simulation: add configuration items for abnormal scenario simulation in the configuration file, such as simulating network jitter, packet loss, delay, etc., observe the processing ability of the video stream processing module when facing these anomalies, and ensure that it can run stably under various network conditions.
[0121] Furthermore, the performance test data recorded can be diversified: in addition to recording conventional performance indicators such as throughput and latency, more detailed data can be recorded, such as CPU utilization, memory usage, disk IO, etc., in order to more comprehensively evaluate the performance of the video stream processing module.
[0122] Furthermore, multi-point streaming tests can be introduced: simulating devices in multiple geographical locations to pull video streams simultaneously, testing the performance of the video stream processing module in a distributed scenario, and ensuring that it can provide stable video streaming services worldwide.
[0123] Furthermore, you can also configure the streaming priority: set the streaming priority of different devices, simulate the importance of different users or devices, and test how the video stream processing module allocates processing resources when resources are limited.
[0124] S400, monitor the performance data of the server in real time and generate an analysis report.
[0125] Specifically, deploy monitoring tools: use tools such as Prometheus and Xshell to monitor various performance data of the server in real time during the video stream processing. These tools can help collect and display the operating status of the server, including but not limited to CPU utilization, memory usage, network traffic, load, etc.
[0126] Monitoring data collection: Prometheus is used to monitor various indicators of the server, including CPU usage, memory usage, network bandwidth usage, etc., to ensure that the operating status of the server can be understood in real time.
[0127] Real-time data display: Use tools such as Xshell to monitor the running status of each server service in real time, including but not limited to the CPU usage and memory usage of a single service.
[0128] Data recording and analysis: The collected data will be recorded for subsequent analysis. This data can be used to analyze the overall performance of the server when processing video streams and identify whether there are performance bottlenecks.
[0129] Generate analysis reports: Generate visual reports based on the collected data to help technicians intuitively understand the performance of the server in processing video streams. The report can include charts, trend analysis, etc., which is convenient for analyzing the performance bottleneck of the server.
[0130] For example, deploy monitoring tools: install and configure Prometheus and Xshell tools to ensure that they can monitor the performance data of the server in real time. Prometheus is mainly used to collect server-level indicators, such as CPU utilization, memory usage, network traffic, etc.; Xshell can be used to monitor the specific operating status of each service on the server in real time, including but not limited to the CPU utilization and memory usage of a single service.
[0131] Monitoring data collection: Set monitoring rules through Prometheus to regularly capture key performance indicators on the server. For example, set the collection of CPU utilization, memory usage, network input and output traffic, and other data once a minute.
[0132] Real-time data display: Configure the Xshell tool to display the running status of each server service in real time. For example, you can set the Xshell to refresh the display every few seconds to show the CPU and memory usage of each service.
[0133] Data recording and analysis: The data collected by Prometheus is stored and analyzed through Prometheus's query language (PromQL). For example, you can view the time period when the CPU utilization exceeded 80% in the past hour, or find the peak time of memory usage.
[0134] Generate analysis reports: Generate visual reports based on the collected data. You can use the Prometheus built-in Dashboard function or other third-party tools (such as Grafana) to create charts and trend graphs to intuitively display the performance of the server. The report can include the following:
[0135] A trend graph showing CPU utilization over time.
[0136] Statistics of memory usage, including peak and average usage.
[0137] Real-time monitoring of network traffic, including upload and download speeds.
[0138] Overview of CPU and memory usage by service.
[0139] Furthermore, you can also add monitoring indicators: in addition to the commonly used basic indicators such as CPU utilization, memory usage, network traffic and load, you can also add monitoring of additional indicators such as disk I / O read and write speed, disk space usage, number of system processes, etc., to have a more comprehensive understanding of the server's operating status.
[0140] Furthermore, an alarm mechanism can be integrated: the alarm function is integrated into the monitoring tool, and when certain key performance indicators exceed the preset threshold, an alarm notification is automatically sent to relevant personnel so that performance issues can be handled in a timely manner.
[0141] Furthermore, historical data can be retained and analyzed: historical performance data for a long period of time can be retained to identify performance fluctuation patterns through trend analysis, predict performance bottlenecks that may occur in the future, and make optimization adjustments in advance.
[0142] Furthermore, you can customize the report templates: according to different test purposes and requirements, you can customize different types of analysis report templates. For example, you can make a simplified report template for daily maintenance, while you can generate a report with more details for performance tuning.
[0143] Furthermore, you can also perform correlation analysis on performance indicators: not only monitor each performance indicator separately, but also analyze the correlation between different indicators, for example, whether the increase in CPU utilization is accompanied by an increase in memory usage, or whether a surge in network traffic affects the CPU load.
[0144] Furthermore, you can also conduct multi-dimensional comparative analysis: perform horizontal and vertical comparative analysis on performance data of different time periods, such as today and yesterday, this week and last week, etc., to discover performance change trends.
[0145] Comparison of performance test results: Between different test rounds, compare and analyze the changes in monitoring data to find out which adjustment measures are effective and which ones need further optimization.
[0146] Furthermore, a performance prediction model can be designed: a performance prediction model can be established based on historical monitoring data to predict the performance of the server under specific load conditions and provide a reference for future system expansion.
[0147] Furthermore, user experience indicators can also be targeted: in addition to server-side performance data, performance indicators related to user experience can also be introduced, such as user access delay, page loading time, etc., to ensure the service quality for end users.
[0148] S500: Identify performance bottlenecks based on the performance data and analysis report obtained through monitoring, adjust test parameters or optimize service performance, and perform iterative testing until predetermined performance requirements are met.
[0149] Specifically, analyze test reports: Identify overall server performance bottlenecks and individual service performance bottlenecks through performance data and analysis reports generated by monitoring tools (such as Prometheus). This includes checking key performance indicators such as CPU utilization, memory usage, network traffic, and load.
[0150] Identify performance bottlenecks: Find out where performance is not up to standard from the report, such as high CPU utilization, memory usage reaching the upper limit, insufficient network bandwidth, etc. These indicators can reflect the problems that the system has when processing video streams.
[0151] Adjust test parameters: Adjust test parameters based on the performance bottlenecks found. For example, if you find that the CPU usage has reached the upper limit, you can consider reducing the number of concurrent streaming devices or adjusting the resolution and bit rate of the video stream; if the memory usage has reached the upper limit, you can consider increasing the memory allocation of the virtual machine; if the network bandwidth is insufficient, you can adjust the network bandwidth limit or optimize the video compression algorithm to reduce bandwidth consumption.
[0152] Optimize service performance: In addition to adjusting test parameters, you can also directly optimize service performance. For example, you can optimize the video processing algorithm to reduce CPU usage, or improve the memory management strategy to reduce memory usage; reduce unnecessary computing burden through code-level optimization.
[0153] Iterative testing: After adjusting the test parameters or optimizing service performance, restart the video stream processing module for a new test round, continue to monitor performance data and generate a new analysis report. Repeat this process until the test results meet the predetermined performance requirements.
[0154] For example, in the analysis test report: Assume that through Prometheus and Xshell tools, it is monitored that during the video stream processing, the server's CPU utilization often reaches more than 95%, the memory utilization reaches 80%, and the network bandwidth utilization is also at a high level.
[0155] Identify performance bottlenecks: From the monitoring data, it is found that high CPU utilization may be due to insufficient processing capacity of the video stream processing module in high-concurrency scenarios. High memory usage may be caused by a large number of video streams being pushed to the server at the same time. High network bandwidth usage may be due to the video stream bit rate being set too high, resulting in high network transmission pressure.
[0156] Adjust the test parameters:
[0157] Adjust CPU usage: If you find that the problem lies with the video stream processing module, you can adjust the number of concurrent processing of the module to reduce the number of video streams processed simultaneously.
[0158] Optimize memory usage: You can increase the memory allocation of the virtual server, or optimize the memory management strategy of the video stream processing module to reduce unnecessary cache data.
[0159] Adjust network bandwidth: If the bit rate of the video stream is set too high, you can appropriately lower the bit rate of the video stream, or use a more efficient video encoding format to reduce the use of network bandwidth.
[0160] Optimize service performance:
[0161] Optimize video processing algorithm: Reduce CPU usage by optimizing the video processing algorithm in the video stream processing module.
[0162] Improved memory management strategy: Reduce memory usage by improving memory management strategy.
[0163] Video compression optimization: Use more advanced video compression technology to reduce the bit rate of video streams and reduce the pressure on network transmission.
[0164] Iterative testing: After adjusting the test parameters or optimizing service performance, restart the video stream processing module for a new test round. Continue to monitor performance data and generate new analysis reports to view the effects of the adjustments. If problems still exist, adjust the parameters or optimize service performance again until the test results meet the predetermined performance requirements.
[0165] Furthermore, the performance bottleneck location can be refined: in addition to identifying the overall performance bottleneck, it can also be broken down into specific subsystems or components, such as network transmission, video decoding, database access, etc., and the source of the problem can be accurately located through more detailed monitoring indicators.
[0166] Furthermore, you can also adjust parameters in multiple dimensions: when adjusting test parameters, you can try from multiple dimensions, such as adjusting the bit rate, resolution, audio options, etc. of the video stream to find the best balance between video quality and performance.
[0167] Furthermore, A / B testing can be introduced: when optimizing service performance, the A / B testing method can be used to run two or more different optimization schemes at the same time and compare their effects to select the optimal scheme.
[0168] Furthermore, machine learning models can be introduced: use machine learning models to analyze historical performance data, predict performance under different parameter settings, and guide the direction of parameter adjustment.
[0169] Furthermore, a performance optimization suggestion system can be developed to automatically make optimization suggestions based on monitoring data, such as adjusting the CPU, memory allocation, optimizing video processing algorithms, etc.
[0170] In some embodiments of the present application, the determining of the test objectives and test requirements, and configuring and adjusting the virtual server resources according to the test requirements, are specifically:
[0171] Develop a test plan based on the expected workload, key performance indicators and specific needs of the video server;
[0172] Create virtual server instances in the virtualization resource manager and accurately configure the required resources for each instance, including the allocation of CPU, memory size, and network bandwidth settings;
[0173] Based on the problems found during the test or to verify the performance under different configurations, dynamically adjust the CPU quota, memory limit and bandwidth control of the network interface through the virtualization resource manager.
[0174] Specifically, develop a test plan: develop a detailed test plan based on the expected workload of the video server, key performance indicators, and specific customer needs. For example, if the video server needs to support high-concurrency access, then the test plan should include relevant indicators that simulate high-concurrency scenarios; if the customer is particularly concerned about the latency of the video stream, then the test plan needs to set specific goals for the latency test.
[0175] Create virtual server instances: Create virtual server instances in the virtualization resource manager and accurately configure the required resources for each instance. Specifically, this means that the resource configuration of the virtual server needs to be determined according to the performance indicators determined in the test plan, including the allocation of CPU, memory size, and network bandwidth settings. For example, if the test plan requires simulating 500 concurrent users, it may be necessary to configure a virtual server instance with enough CPU cores (such as 8 cores), large memory (such as 16GB), and appropriate bandwidth (such as 100Mbps).
[0176] Dynamically adjust resources: During the test, based on the problems found or to verify the performance under different configurations, dynamically adjust the CPU quota, memory limit, and bandwidth control of the network interface through the virtualization resource manager. For example, if the CPU utilization is too high during the test, you can increase the CPU quota; if the memory usage is close to the upper limit, you can increase the memory allocation; if the network bandwidth becomes a bottleneck, you can adjust the bandwidth setting.
[0177] In some embodiments of the present application, the configuration video stream generation module is used to simulate the generation of the video stream, and the device registration information, access protocol, serial number rules and reconnection mechanism are set, specifically:
[0178] Set key parameters through the configuration file of the video stream generation module.
[0179] Clearly specify the IP address and port number of the simulated device registration and online server;
[0180] Define the protocol used when simulating device access, and simulate different protocols and device access from different manufacturers;
[0181] Set up rules to generate device serial numbers, ensuring that each simulated device has a unique and easily traceable identifier;
[0182] Specify the device online policy, including the number of devices online for the first time and the number of devices allowed to go online per second;
[0183] Define the video stream bitrate, resolution, whether to include audio, and streaming duration parameters to simulate video streaming scenarios under different network conditions;
[0184] Set the device offline frequency and reconnection mechanism parameters to simulate the situation where the device frequently goes online and offline in an unstable network environment, including the device offline period, the interval time between reconnection attempts, and the maximum number of reconnection attempts.
[0185] Specifically, set key parameters: set a series of key parameters through the configuration file of the video stream generation module to ensure that the device can successfully register and efficiently access the system. These parameters include the IP address and port number of the simulated device registration and online server to ensure that the device can accurately connect to the server.
[0186] Define device access protocol: Set the protocol used when the device is accessed, and simulate different protocols and device access from different manufacturers. For example, you can define RTSP, RTMP or private protocols used when the device is accessed to ensure that the test environment is compatible with a variety of device access situations.
[0187] Generate device serial number rules: Set rules to generate device serial numbers to ensure that each analog device has a unique and easy-to-track identifier. For example, you can set the serial number to consist of a prefix plus numbers or letters, such as device_####, where #### represents four digits, to ensure that each device has a unique identifier.
[0188] Specify device online strategy: Specify the device online strategy, including the number of devices that are online for the first time and the number of devices that are allowed to go online per second. For example, you can set the number of devices that are online for the first time to 50 and the number of devices that are online per second to 5 to simulate the load conditions at system startup or test start and to simulate the device access rate in the real world.
[0189] Configure video stream parameters: Define various parameters of the video stream, including video bitrate, resolution, whether to include audio, and streaming duration, to ensure that various streaming scenarios and conditions can be accurately simulated. For example, you can specify the bitrate of the simulated video stream to be 1024kbps, the resolution to be 1280x720, the streaming duration to be 3600 seconds, and choose whether to add audio to the video stream.
[0190] Set reconnection mechanism parameters: Set the device offline frequency and reconnection mechanism parameters to simulate the situation where the device frequently goes online and offline in an unstable network environment. For example, you can set the device to automatically go offline after a certain time interval, such as automatically going offline every 60 seconds, to simulate disconnection in a weak network environment. At the same time, define the device's reconnection strategy, including the interval time for reconnection attempts and the maximum number of reconnections, such as setting the reconnection interval to 10 seconds and the maximum number of reconnections to 5 times.
[0191] In some embodiments of the present application, the starting video stream processing module receives and processes the video stream and performs a performance test, specifically:
[0192] The address and port of the streaming server are defined in the configuration file of the video stream processing module so that the processing module can correctly connect to the server, configure the streaming protocol to ensure smooth transmission and compatibility of the video stream, ensure that the streaming device serial number rule is consistent with the video stream generation module, and configure the number of devices allowed to stream simultaneously, so as to simulate the load situation in actual applications;
[0193] Define the device link strategy and video stream playback mode in the configuration file, including the number of devices to be linked for the first time and the rule for increasing the number of device links, to simulate the dynamic change of the number of users and select the video stream playback mode;
[0194] Set the streaming duration in the configuration file according to test requirements to cover different scenarios from short-term viewing to long-term monitoring;
[0195] Use JMeter to record the key performance indicators of server throughput and latency during the simulated device registration and onboarding process.
[0196] Specifically, configure the streaming server information: define the streaming server address and port in the configuration file of the video stream processing module to ensure that the processing module can correctly connect to the video stream server. For example, the server IP address can be set to 192.168.1.10 and the port number to 8080.
[0197] Configure streaming protocol: Define the protocol used for video streaming, such as RTSP, RTMP, or a private protocol, to ensure that the video stream can be transmitted smoothly and is compatible with different devices. For example, you can select the RTMP protocol to process the video stream.
[0198] Maintain serial number rule consistency: Ensure that the serial number rule of the stream pulling device in the video stream processing module is consistent with that of the video stream generation module so that the analog device can be properly connected. For example, the serial number rule can be set to device_#### (where #### represents a four-digit number) to ensure that each device has a unique identifier.
[0199] Configure the number of devices that are allowed to pull streams simultaneously: Set the number of devices that are allowed to pull streams simultaneously to simulate the load conditions in actual applications. For example, you can set the number of devices that are allowed to pull streams simultaneously to 100 to simulate a higher load scenario.
[0200] Define device linking strategy: Define the device linking strategy in the configuration file, including the number of devices linked for the first time and the rule for increasing the number of device links, to simulate the dynamic change of the number of users. For example, you can set the number of devices linked for the first time to 20, and set the number of devices that increase per second to 5, to simulate the situation where the number of users gradually increases.
[0201] Select video stream playback mode: Select the playback mode of the video stream, providing two options of "Real-time Preview" or "Recording Playback" to affect the data processing flow of the video stream processing module and the focus of performance testing. For example, you can select the "Real-time Preview" mode to test the real-time video stream processing performance.
[0202] Set the streaming duration: Set the streaming duration in the configuration file according to the test requirements to cover different scenarios from short-term viewing to long-term monitoring. For example, you can set the streaming duration to 3600 seconds (i.e. 1 hour) to simulate long-term video stream processing.
[0203] Record performance indicators: Use the JMeter tool to record key performance indicators such as server throughput and latency during the registration and launch of simulated devices. For example, you can record data such as the number of video streams processed per second and the average latency time.
[0204] In some embodiments of the present application, the real-time monitoring of the performance data of the server and the generation of an analysis report are specifically as follows:
[0205] Deploy Prometheus and Xshell tools, and use Prometheus to monitor various data of the server in the process of pulling streams in real time, including but not limited to CPU utilization, memory usage, network traffic, and load; use Xshell to monitor the data of various services on the server in real time;
[0206] Generate analysis reports based on the collected data to compile and analyze the test results.
[0207] Specifically, deploy monitoring tools: install and configure Prometheus and Xshell tools. Prometheus is mainly used to monitor various performance indicators of the server in real time, such as CPU utilization, memory usage, network traffic, load, etc. Xshell is used to monitor the specific operating data of each service on the server in real time, including but not limited to the CPU utilization and memory usage of a single service.
[0208] Real-time data collection: Prometheus is used to collect various performance data of the server in the process of pulling streams in real time. For example, you can set it to collect data such as CPU utilization, memory usage, network input and output traffic once a minute.
[0209] Real-time data display: Use the Xshell tool to display the running status of each service on the server in real time. For example, you can set the Xshell to refresh the display every few seconds to display the CPU and memory usage of each service.
[0210] Data recording and analysis: Store the data collected by Prometheus and analyze it through Prometheus query function. For example, you can view the time period when the CPU utilization exceeded 80% in the past hour, or find the peak time of memory usage.
[0211] Generate analysis report: Generate analysis report based on the collected data. You can use the Dashboard function of Prometheus or other third-party tools (such as Grafana) to create charts and trend charts to intuitively display the performance of the server. The report can include the following:
[0212] A trend graph showing CPU utilization over time.
[0213] Statistics of memory usage, including peak and average usage.
[0214] Real-time monitoring of network traffic, including upload and download speeds.
[0215] Overview of CPU and memory usage by service.
[0216] In some embodiments of the present application, the performance bottleneck is identified based on the performance data and the analysis report obtained through monitoring, and the test parameters are adjusted or the service performance is optimized, and the test is iterated in a loop until the predetermined performance requirements are met, specifically:
[0217] Through the analysis report, analyze and identify the overall performance bottleneck of the server and the performance bottleneck of individual services, including checking CPU utilization, memory usage, network traffic and load key indicators;
[0218] According to the analysis results in the analysis report, adjust the configuration of virtualized resources and optimize service performance, including adjusting service configuration parameters and improving code logic;
[0219] Conduct new test rounds until the test results meet the predetermined performance requirements, including reconfiguring virtualized resources, performing performance tests again, and continuously monitoring performance data;
[0220] After each iteration, analyze the test report again to confirm whether the performance bottlenecks found previously have been resolved. If there are still performance indicators that do not meet the standards, you need to continue to adjust parameters or optimize services until all performance indicators meet expectations.
[0221] Specifically, analyze and identify performance bottlenecks: By analyzing reports, check the overall performance bottlenecks of the server and the performance bottlenecks of individual services. This includes looking at key indicators such as CPU utilization, memory usage, network traffic, and load to determine where performance problems exist. For example, if you find that CPU utilization is continuously high, or memory usage is close to the upper limit, or network traffic exceeds expectations, these may be signs of performance bottlenecks.
[0222] Adjust virtualization resource configuration: Based on the analysis results in the analysis report, adjust the configuration of virtualization resources. This may involve increasing or decreasing CPU quotas, adjusting memory limits, changing bandwidth control of network interfaces, etc. For example, if you find that the CPU has become a bottleneck, you can increase the CPU quota; if memory usage is high, you can increase memory allocation.
[0223] Optimize service performance: In addition to adjusting resource configuration, you also need to optimize service performance. This includes adjusting service configuration parameters, improving code logic, etc. For example, you can reduce resource consumption by adjusting the number of concurrent processing of the service, optimizing internal algorithms, etc.
[0224] Iterative testing: Perform new rounds of testing until the test results meet the predetermined performance requirements. This means reconfiguring virtualized resources, performing performance testing again, and continuously monitoring performance data. For example, after adjusting the CPU quota, you need to restart the test to see if the CPU utilization has decreased and the performance has improved.
[0225] Confirm whether the performance bottleneck has been resolved: After each iteration, analyze the test report again to confirm whether the previously discovered performance bottleneck has been resolved. If there are still performance indicators that are not up to standard, you need to continue to adjust parameters or optimize services until all performance indicators meet expectations. For example, if the CPU utilization is still high after adjustment, you need to further optimize the service logic or increase resource allocation until the problem is resolved.
[0226] Example 2
[0227] A video service stress testing system, comprising:
[0228] Video stream generation module, used to simulate and generate a large number of video streaming requests;
[0229] The video stream processing module is responsible for encoding, decoding and forwarding operations of video streams. It allows key parameters to be defined through configuration files, such as the total number of streams pulled, the frequency of streams pulled per second, the incremental strategy, the reconnection mechanism and the concurrent processing capability.
[0230] Performance testing module, used to simulate user preview and playback behaviors and test key performance indicators of video services;
[0231] Monitoring and data analysis module, which is used to deploy Prometheus and Xshell tools to monitor video service performance in real time and realize data visualization;
[0232] The virtualization resource manager is used to use Docker containerization technology to achieve refined dynamic management of virtualized resources, including but not limited to quota adjustment of CPU resources, dynamic scaling of memory limits, and bandwidth control of network interfaces. Kubernetes is used as the container orchestration engine to achieve efficient scheduling and elastic scaling of resources, ensuring high availability and performance optimization of services.
[0233] In some embodiments of the present application, the video stream processing module is connected to the video stream generating module by configuring the address and port of the stream pulling server.
[0234] In some embodiments of the present application, the performance testing module is connected to the video stream processing module, and the monitoring and data analysis module and the virtualization resource manager are connected to other modules.
[0235] Example 3
[0236] An electronic device comprises a memory, a processor and a program stored in the memory and executable on the processor, wherein when the processor executes the program, the steps in a video service stress testing method as described in any one of claims 1 to 6 are implemented.
[0237] Anything not described in this application can be achieved by adopting or drawing on existing technologies.
[0238] The various embodiments in this specification are described in a progressive manner, and the same or similar parts between the various embodiments can be referenced to each other, and each embodiment focuses on the differences from other embodiments.
[0239] The above is only an embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various changes and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.
Claims
1. A video service stress testing method, characterized in that: include: Determine test objectives and test requirements, and configure and adjust virtual server resources according to test requirements; Configure the video stream generation module to simulate the generation of video streams, set device registration information, access protocol, serial number rules, and reconnection mechanism; Starting the video stream processing module to receive and process the video stream and perform a performance test; Monitor the server's performance data in real time and generate analysis reports; The performance bottleneck is identified based on the performance data and analysis report obtained through monitoring, and the test parameters are adjusted or the service performance is optimized, and the test is iterated in a loop until the predetermined performance requirements are met.
2. The method according to claim 1, characterized in that Determining the test objectives and test requirements, and configuring and adjusting the virtual server resources according to the test requirements, specifically includes: Develop a test plan based on the expected workload, key performance indicators and specific needs of the video server; Create virtual server instances in the virtualization resource manager and accurately configure the required resources for each instance, including the allocation of CPU, memory size, and network bandwidth settings; Based on the problems found during the test or to verify the performance under different configurations, dynamically adjust the CPU quota, memory limit and bandwidth control of the network interface through the virtualization resource manager.
3. The method according to claim 1, characterized in that The configuration video stream generation module is used to simulate the generation of video streams, and the device registration information, access protocol, serial number rules and reconnection mechanism are set, specifically: Set key parameters through the configuration file of the video stream generation module. Clearly specify the IP address and port number of the simulated device registration and online server; Define the protocol used when simulating device access, and simulate different protocols and device access from different manufacturers; Set up rules to generate device serial numbers, ensuring that each simulated device has a unique and easily traceable identifier; Specify the device online policy, including the number of devices online for the first time and the number of devices allowed to go online per second; Define the video stream bitrate, resolution, whether to include audio, and streaming duration parameters to simulate video streaming scenarios under different network conditions; Set the device offline frequency and reconnection mechanism parameters to simulate the situation where the device frequently goes online and offline in an unstable network environment, including the device offline period, the interval time between reconnection attempts, and the maximum number of reconnection attempts.
4. The method according to claim 1, characterized in that: The starting video stream processing module receives and processes the video stream and performs a performance test, specifically: The address and port of the streaming server are defined in the configuration file of the video stream processing module so that the processing module can correctly connect to the server, configure the streaming protocol to ensure smooth transmission and compatibility of the video stream, ensure that the streaming device serial number rule is consistent with the video stream generation module, and configure the number of devices allowed to stream simultaneously, so as to simulate the load situation in actual applications; Define the device link strategy and video stream playback mode in the configuration file, including the number of devices to be linked for the first time and the rule for increasing the number of device links, to simulate the dynamic change of the number of users and select the video stream playback mode; Set the streaming duration in the configuration file according to test requirements to cover different scenarios from short-term viewing to long-term monitoring; Use the JMeter tool to record key performance indicators such as server throughput and latency during simulated device registration and onboarding.
5. The method according to claim 1, characterized in that The real-time monitoring of the server's performance data and the generation of an analysis report are specifically as follows: Deploy Prometheus and Xshell tools, and use Prometheus to monitor various data of the server in the process of pulling streams in real time, including but not limited to CPU utilization, memory usage, network traffic, and load; use Xshell to monitor the data of each service on the server in real time; Generate analysis reports based on the collected data to compile and analyze the test results.
6. The method according to claim 1, characterized in that The performance bottleneck is identified based on the performance data and analysis report obtained through monitoring, and the test parameters are adjusted or the service performance is optimized, and the test is iterated in a loop until the predetermined performance requirements are met, specifically: Through the analysis report, analyze and identify the overall performance bottleneck of the server and the performance bottleneck of individual services, including checking CPU utilization, memory usage, network traffic and load key indicators; According to the analysis results in the analysis report, adjust the configuration of virtualized resources and optimize service performance, including adjusting service configuration parameters and improving code logic; Conduct new test rounds until the test results meet the predetermined performance requirements, including reconfiguring virtualized resources, performing performance tests again, and continuously monitoring performance data; After each iteration, analyze the test report again to confirm whether the performance bottlenecks found previously have been resolved. If there are still performance indicators that do not meet the standards, you need to continue to adjust parameters or optimize services until all performance indicators meet expectations.
7. A video service stress testing system, characterized in that: include: Video stream generation module, used to simulate and generate a large number of video streaming requests; The video stream processing module is responsible for encoding, decoding and forwarding operations of video streams. It allows key parameters to be defined through configuration files, such as the total number of streams pulled, the frequency of streams pulled per second, the incremental strategy, the reconnection mechanism and the concurrent processing capability. Performance testing module, used to simulate user preview and playback behaviors and test key performance indicators of video services; The monitoring and data analysis module is used to deploy Prometheus and Xshell tools to monitor video service performance in real time and realize data visualization; The virtualization resource manager is used to use Docker containerization technology to achieve refined dynamic management of virtualized resources, including but not limited to quota adjustment of CPU resources, dynamic scaling of memory limits, and bandwidth control of network interfaces. Kubernetes is used as the container orchestration engine to achieve efficient scheduling and elastic scaling of resources, ensuring high availability and performance optimization of services.
8. The system according to claim 7, characterized in that The video stream processing module is connected to the video stream generating module by configuring the address and port of the stream pulling server.
9. The system according to claim 7, characterized in that The performance testing module is connected to the video stream processing module, and the monitoring and data analysis module and the virtualization resource manager are connected to other modules.
10. An electronic device comprising a memory, a processor, and a program stored in the memory and executable on the processor, characterized in that: When the processor executes the program, the steps in the video service stress testing method according to any one of claims 1 to 6 are implemented.
Citation Information
Cited By
Method, device and equipment for testing optical communication network
CN120785424A
A testing method, apparatus, and equipment for optical communication networks.
CN120785424B