Mediasoup video lags

Hello everybody. I use Mediasoup in my project. Raised ubuntu on the server. When developing the application, I used the example GitHub - Dirvann/mediasoup-sfu-webrtc-video-rooms: A simple video conferencing example using the mediasoup sfu. With a group call of up to 6 people, it works fine. If more people connect, video lags and loss of quality begin and everything starts to lag and slow down. Although the server cpu is loaded by 20% and the laptop is loaded by 55-60%. When 10 -11 people come in, they are simply thrown out of the call. Tested chrome on laptops and browser. I am a beginner in webrtc. Please help.

Sounds like you’re pushing the limits of your core, introductory of pipetransports and workers should help you extend this usage to 100% properly.

Many to many is very difficult, viewers cost the server loads of CPU and when you 100% a CPU, you get loop lag, inability to render the next lines of code till current queue/item is finished. In this case it sounds like you maxed out a core.

Thanks for the answer. You can give an example or link to an example? I will be grateful

What about reading the documentation instead of just looking for examples?

1 Like

You utilized a link that may or may not be appropriate as an example for yourself. We cannot help in these cases but suggest a path suitable, go and use the official demo first and review the v3 API documentation. Cheers. (As hinted, workers and pipe transports will be the sauce to expand the many-to-many)

IBC beat me to it, haha good luck.

1 Like

I am here creating workers by the number of cpu. It turns out that they are not enough or what? I didn’t fully understand your advice about workers. Sorry for the stupid question.

It looks like you are not gonna read the mediasoup website documentation, right?

sorry, I read but did not really understand where to use

Not really much to say, but you’re reaching limits and need to utilize both Workers and Pipe Transports to make this work. Last but not least, ensuring your workers don’t max out in CPU so you can effectively prevent any hiccups. However you do this, is up to you. I run user limits some may calculate differently.

Do read more, it’ll take weeks->months to understand and far greater for beginner coders this is advanced stuff.

thank you very much good man

How about the network load? With n inbound tracks, there are n*(n-1) outbound ones.