Why does the RTMP protocol online education classroom web video on-demand platform EasyDSS cause the system to freeze after a large number of devices are turned on for recording?

The EasyDSS video platform provides live video and on-demand functions. Of course, if you need to call the video playback, you can also choose the video version to store the video. However, in the video recording function, if all the video recording functions are turned on, if it is run on a poor server, the system will be stuck in a dead state and cannot operate normally.

Video 1.png

Check port 10085 in the background. Port 10085 is the default rtmp push port in EasyDSS. A large number of requests for CLOSE_WAIT port status are found.

70.png

The C layer mainly uses nginx to process rtmp push data, so it adopts a single-task mode, that is, after processing an event task, the next event task will be processed. There are a large number of CLOST_WAIT ports in the figure, which proves that a large number of http requests are waiting to be processed. Over time, these ports will slowly disappear.

Therefore, it is important to query which tasks are running in the blocking queue. After analysis, it is believed that the I/O read and write to the disk is blocking the task queue. Check the kernel configuration file.

71.png

In principle, because of the disk I/O blocking problem, it is a service system performance problem, which can be handled very small at the code level. But because of customer requirements, try to support the largest number of channels.

The current default recording time is 4s, that is, for a video stream, you need to open the file once, write the file and close the file within 4s by default. The operation of writing to the file cannot be omitted. Therefore, it is optimized to reduce the operation of opening and closing files, and the recording time is modified to 20s, that is, one stream, 20s will open and close the file once. A lot of reduced consumption in this area.

After the modification, the customer's requirements were met. However, in this case, if one stream push is less than 20s, it cannot be recorded, so you should choose the corresponding recording time according to the actual scene.

Video 2.png

Guess you like

Origin blog.csdn.net/Black_3717/article/details/113125412