MediaSoup scalability

In our implementation, we use pipeToRouter method and it works like a charm. It’s not very easy, you need to figure out how to distribute the load depending on the type of your application.

There is a limit (500) for maximum number of connections per worker (cpu or core). So, in order to support much more viewers, you can use some workers just for publishers and you can use some workers just for viewers. Using pipeToRouter method, you can pipe a live stream to another router on the viewer workers. And then, you can distribute new consumers to routers on the viewer workers using a load balancing algorithm (e.g. round-robin).

There is a good discussion about mediasoup scalability where you can find here.