increasing number of connections to mediasoup server

I am running mediasoup using a node server (clients use mediasoup-client).
Currently, I am able to connect around 1000 peers.

This currently uses a small fraction of the CPU, so I looked at how I can increase the number of connections to the server.

First I tried increasing connection limit on the OS level, following these:
link 1
link 2

  • but this didn’t have any effect.

Then I came across a thread (can’t post another link :/) called
"using multiple consumers in a single recvTransport
where it is mentioned I should reuse a single recv transport for all consumers.
I Tried doing so - instead of creating a new transport for each peer - creating only 1 and handing all following peers this single transport - this didn’t work.
Obviously, tried debugging - but no luck so far. Only error I got was

connect was already called on transport

figured I should call this only once.

I am wondering whether there is something I am missing - if I should create that single transport slightly different, in order to reuse it?
I am seeing (my server implementation is fairly similar to the mediasoup-sandbox demo) that a transport is created with a notion of a peer - in appData property.

Any thoughts?

Unclear how to help here. Obviously you should create a single WebRTC transport to receive all Consumers and you should just call connect() once on it when appropriate (when the client side transport emits “connect” event). Everything is documented and you can also check the official mediasoup-demo project. But everything is documented, so saying that you have copied what the “mediasoup-sandbox” demo does is not enough (I don’t know that code anyway).

The question is related to the mediasoup server. We would like to verify we understood it correctly -
Every browser/client has it’s own transport in the server. We cannot reuse the transport on the server for multiple browsers/clients, right?


1 Like