High media node load using rtmp module

Hello everyone, I’m currently developing an application that utilizes OpenVidu PRO on premises, with a media node machine equipped with 4 vCPUs and 16GB RAM. However, I’ve noticed that when I enable the rtmp export module with a custom layout, the media node experiences extremely high loads. Surprisingly, even with just one participant in a session, the load reaches around 40%. On the other hand, when I only use the webRTC connection, the load remains around 2%. I’ve attempted to eliminate the custom layout and stream to an alternative platform like YouTube, but the load remains within the same range. Could you please enlighten me on whether this level of load is normal for the media node? Thank you for taking the time to assist me.

Broadcasts utilizes the COMPOSED recording services, a module designed to create a container in the Media Node. This container initiates a headless browser and transmits the Media through the utility of ffmpeg.

Currently, the only way to reduce the CPU usage is predominantly achievable by lowering the parameters of resolution and framerate within the broadcast.

The level of CPU usage is correct.

Regards.

I understand that broadcasting in RTMP from WebRTC needs some transcoding but the CPU usage is extremely high for just one stream.

If I’m not wrong, in the previous version of openvidu PRO, the CPU load wasn’t the same as now when we talk about broadcast to external platforms like Youtube / Twitch.

Also, the AWS MediaLive wasn’t working as well. Have any change done to the current version that can make this high load happen?

Best regards,

@Henrique_Otsuka, I will reach out to the OpenVidu Team about your problem. I wanted to inform you that we have made modifications to the module in order to make it compatible with AWS Media Live. Are you testing OpenVidu 2.27.0?

To clarify, the num of streams is not the problem. The process which consumes more is the ffmpeg process which actually capture the media of the headless browser. So probably, if you test with more people in the session, the CPU must not increase too much.

Additionally, I would like to ask about the configuration of your AWS Media Live. We would like to understand how it is being set up on your side so that we can explore the available parameters and make it more configurable for OpenVidu users.

@cruizba, The previous version of Openvidu wasn’t working on AWS MediaLive but the current is.

The weird behaviour is that previously, I was able to broadcast 7 streams simultaneously to Youtube / Twitch and now, just 2.

I know that this broadcast module use COMPOSED service and there is some increase in the usage, but the difference between the versions is really crazy.

Hi Henrique;

with this, do you mean that previously you streamed 7 independent sessions? (As in, 7 rooms with N people on each room)

As Carlos mentioned, how many people are in each room does not affect CPU usage too much, so the value of N doesn’t matter. But the fixed cost per session does matter.

We made changes to the way the RTMP export works, to accommodate very strict requirements of AWS MediaLive. That’s why it started working since OpenVidu 2.27. We’ll revisit this to find how we can go back to lower resource usage, while keeping AWS compatibility.

Hello j1elo,

I’ve meant 7 differents rooms / sessions. About the participants of each room, I’ve tested and each one increase 1,5% in CPU usage, probably because of WebRTC Session and the video-tag into the HTML of the headless browser.

The fact is that the number of broadcast RTMP simultaneously is really high. As a parameter, I’m simulating the scenario into my own computer that is a I5-7300HQ with 17 browser tabs opened and streaming a video provided by WebRTC in RTMP and my usage is like 30%.

A server which has way more cores and skylake processors would support more streams than mine.

Thank you in advance. It will be important to have these kind of feature working well.

Best Regards,

After having released support of RTMP broadcasting to AWS MediaLive with OpenVidu 2.27 -which came with an increase of CPU usage for every streamed session- we have continued working on this, and were recently able to identify a chance for optimization. This change can bring CPU usage down around 15 to 25%, to similar levels that we had with OpenVidu 2.26 (before introduction of AWS MediaLive support).

This is good news because it means equally performant broadcasting support for all tree main platforms tested (Twitch, YouTube, MediaLive).

After checking with the development team, these changes will be incorporated in the next release of OpenVidu 2.28, which is scheduled for publication during next week. This should be good news for all teams using the Broadcast feature, as they will be able to stream more sessions without having to upgrade to faster CPUs.

@Henrique_Otsuka current version 2.28.0 should fix the High usage CPU on RTMP.

Amazing! I’ll perform some tests about it. This performance increase will be a really healpful for us and allow to scale the business better. After tests I’m gonna give a feedback about it

Thank you in advance!!

Guys, good news!

It’s really optimized now and working 1 stream to 10% usage and I think that it’s way better.

Thank you again for the amazing job.

1 Like