Preferentially optimize latency while broadcasting

I’m running a configuration where I’m broadcasting to a lot of individuals at a time. I see that as the number of participants goes up, so does the latency. I was wondering if there is a way to optimize for the lowest possible latency for a select participant at the expense of other participants. Thanks!

No, there is no a magic way to “improve” latency for a specific receiver. If you get into latency issues it means that you are using too much CPU into a single mediasoup worker.

We wrote detailed doc about mediasoup scalability here:

Thanks! Now that I’m reading this back to me, it does seem like a silly question, sorry about that :slight_smile:

Looks like the best way to do this would be to reserve a worker specifically for the important clients and pipe the streams into a router on that worker with a PipeTransport

It’s definitely up to you how you design your architecture. You may have, for instance:

  • worker_1 that receives the original streams from gstreamer processes and forwards them to worker_2 and worker_3 by using PipeTransports (router.pipeToRouter() method).
  • worker_2 in which “important” clients connect to consume the streams.
  • worker_3 in which “poor” clients connect to consume the streams.

And of course you can launch as many workers as you wish (the recommended max value is the number of CPU cores in the host).

1 Like