mediasoup instance deployement in aws

  1. Can a single worker utilize more than one CPU? For example, in an AWS instance like c5.large with 4 CPUs.
  2. Is it an absolute fact that one worker can handle approximately 500 consumers?

The docs clearly say that a Worker only uses a single CPU core.

No. It’s just an approximation given a very specific machine and mediasoup usage. No magic answers here.

1 Like

I received a response from a member of the mediasoup community stating that a mediasoup instance running on a c5.large with a 2-core CPU can handle up to 4000 consumers. Is this possible, or is he fooling me?

it actually depends upon the server. the 500 consumers per worker is for normal cpu you can say. If core is more powerful then it can handle more than 500 as well. The only way to find it out is through load testing it and see how much it can bear.

On the side note, that 500 consumers per worker things is not just about consumers it is consumers + producers. Be careful with that. Plus in production you do piping between worker to share producers between workers. Each producer piping costs 2 weights i.e 1 producer, 1 consumer. So you don’t want to use your worker fully to 100%, so that you have space to accomodate the piping.

Listen to @ibc

This is absolute bull sh%# if this was audio or video passing through. Data channels would be a different story.


When I test new servers I will check what a single audio or video stream utilizes in CPU and multiply this factor to determine a medium per stream or consider a weight if say a user may toggle video/audio while still broadcasting. So as a good practice test your servers CPU and bandwidth capabilities.

1 Like

according to you what is the better approach, for example having 4 instance with single core cpu of having a single instance with 4 core cpu ?

I’d be buying 4-16vCore machines and many of them, however I guess for testing high availability and scaling you could run many single core instances and sort your code for when the big machines get on board.

1 Like