open-webrtc-toolkit / owt-server

General server (streaming/conference/transcoding/anayltics) for OWT. (A.k.a. MediaServer)
https://01.org/open-webrtc-toolkit
Apache License 2.0
1.13k stars 369 forks source link

CPU consumption is reaching 100% with very less RTSP streams #1144

Open Chandramouli-P opened 2 years ago

Chandramouli-P commented 2 years ago

Hello,

Please find the environment below:

Intel OWT Server: v.5.0 Server: Intel(R) Xeon(R) E-2224G CPU @ 3.50GHz (4 Cores, 32 GB RAM) Operating System: Ubuntu 18.04 (64-bit) Server NodeJS Version: v10.24.1 NPM Version: 6.14.4 Hardware Acceleration: Successfully enabled.

We are transmitting RTSP streams that are coming from IP cameras and rendering on to the Chrome browser in SFU mode. But, when we transmit 10 streams in a single room, CPU consumption is reaching to 100%. We noticed that video agent is occupying almost 151% of CPU resources. Please find the enclosed screen shots for your reference. "intel_gpu_top" tool is also not showing anything.

Screen Shot 2022-01-14 at 12 38 36 PM Screen Shot 2022-01-14 at 12 47 04 PM Screen Shot 2022-01-14 at 12 45 06 PM

Hence, request you to help us in resolving the issue. Thank you.

Best Regards, Chandramouli.

Chandramouli-P commented 2 years ago

Hello,

Good evening and any update would be appreciated. Thank you.

Best Regards, Chandramouli.

qwu16 commented 2 years ago

It seems that the RTSP stream are not directly forward to Chrome but video transcoding is triggered for each stream. This may be caused by a different subscribe codec, resolution, bitrate, framerate or other subscription options. You can just specify the stream id and leave subscription options empty then it will subscribe original RTSP stream without triggering video transcode.

starwarfan commented 2 years ago

Hi, If the picture was the case with only 10 RTSP streams, those streams have been transcoded multiple times. Please check you how many combinations of your subscribe parameters, one set of parameters should trigger transcoding once. If your subscribe options from clients are same, then it's a server issue, we'll look into it,

Chandramouli-P commented 2 years ago

Hello,

Good morning and thank you very much for your help and replies. We are not doing anything and just transmitting with default options only. Please find the below code snippet for your reference:

function subScribe(stream) { let options = { audio: stream.settings.audio.length > 0 ? true : false, video: stream.settings.video.length > 0 ? true : false } conference.subscribe(stream, options) .then((subscription) => { subscirptionLocal = subscription; subscription.addEventListener('error', (err) => { console.log("error", err) }) console.log("stream added") }, (err) => { console.log('subscribe failed', err); }); stream.addEventListener('ended', () => { console.log("stream ended") }); }

If there are any modifications requires, please help us to resolve the issue.

Thank you.

Best Regards, Chandramouli.

starwarfan commented 2 years ago

Could you call REST API to list streams in when your CPU consumption is reaching 100%? I need check your streams' codec. BTW, have you turned off mixing?