Ideal threads for VideoRoom and Streaming plugins

Hi there,

We used to only use the VideoRoom plugin for publishing and viewing WebRTC streams. Recently we switched over to using the Streaming plugin as well, and using the VideoRoom to RTP forward the streams to the Streaming plugin.

When we only used the VideoRoom plugin, we assigned 12 threads for each room, which worked very well. But now that we changed over to both using the VideoRoom and Streaming plugins, what are the ideal threads for both?

Should it be 6 threads / 6 threads, or should one plugin have more threads then the other?

Kind regards,
Jesse de Wild

In general you need to experiment by yourself.
Some notes worth mentioning:

  • The “helper” threads in streaming mountpoint are there to decouple polling from the inbound mountpoint socket and forwarding to WebRTC peers, hence 1 or 2 is often enough.
  • If the number of active participants in your videoroom is not high (like e.g. in a webinar scenario) then using helper threads in the VR might be an overkill.
  • Take a look at event_loops too.

If we disable or put the helper threads to 1 or 2 on the VR, then users experienced a lot of lag and dropouts.

Where can I find the docs for the event_loops, i cannot find it on the VR and Streaming docs.

That’s a core setting in janus.jcfg.
Search in this group, it has been discussed many times.

What is the difference between the ‘threads’ option in the VideoRoom/Streamig plugin config and the ‘event_loops’ option in the global Janus config?

Some users experience stream dropouts after X amount of time.
We use 7 different Janus servers with each 16 CPU cores

We are currently going to change it to the following:

8 CPU cores:
event_loops: 3
videoroom threads: 3
streaming threads: 1

The first are threads in a plugin, the others are threads in the core. They impact completely different areas.

But they do share the same cores right? We currently have multiple servers with some 8 and some 16 CPU cores. Is the following a good set up?

8 CPU cores:
event_loops: 3
videoroom threads: 3
streaming threads: 1