Janus Performance on AWS EC2 instance

Hello to everyone. My big thanks to the wonderful team for creating this awesome server. After searching and reading other suggestions, i have some questions on my own. I am using the videoroom plugin and my goal is to have 100 subscribers in the same room.
This is my setup on AWS:
m5.2xlarge ec2 instance. ( 8vCPU 32 Memory(GiB))
libnice has been updated to the latest version.

My system works well for 30 subscribers in a room or 25 subscribers each in two rooms (total of 50 subscribers). How can i scale out without system overload on one server? What is the limit for the number of subscribers i can have with my setup? Does the thread with number value when creating a room still apply to videoroom? Thanks.

1 Like

As already explained in other posts, the VideoRoom plugin is not optimized for broadcasting: it’s natively conceived for smaller rooms. Either use the Streaming plugin for broadcasting to 100 subscribers, or test the new and experimental helper threads functionality in the VideoRoom:

Thanks for the prompt reply. I am currently using the videoroom-helper-thread branch and i set the thread to 100 with the same goal of having 100 publishers subscribed to one another in the same videoroom.

My system works well for 40 publishers subsribed to one another in a videoroom or 30 publishers subscribed to one another in 3 rooms. This is a slight improvement over the previous result. But is there something i can do further? is the thread value enough? will changing the frontend from vanilla javascript to React js improve the performance? It seems the load average increases exponentially with increase in the number of subscribers above 40. Thanks.

100 subscribe to each other? That’s a completely different thing. First of all, very few endpoints will be able to receive and decode 100 streams, so it’s likely you’re hitting a client side limitation first, not a server side one. Then, your topology means 100*100=10000 streams, basically: you probably want to use more than one Janus server for the job.

That said, I’d encourage you to check if it’s a client thing first. Have 100 users only publish and not subscribe, and have a single user subscribe to them all. My guess is you’ll have trouble on the client side even that way. Pagination is what’s usually done to have that many participants, not “video wall of people” à-la Zoom.

Thanks so much @lorenzo your feedback is always helpful. You are right. We are trying to create a video conference application just like zoom with 100 people engaged in the videoroom. Like you said we will work on the frontend pagination and increase the number of servers. i will post the results soon. Any other advice? Thanks

Hi Lorenzo. My project is on course however can you help clarify this for me? For 10000 streams, whats the appropriate number of streams to use?

Pagination was already discussed in a few other posts. Please use the search future to find the related conversations.

Sorry. i meant the appropriate number for helper threads.

There’s no suggested number. That’s up to you to experiment with.

Hi @lorenzo I am back with another question. With @atoppi help and some digging, i am now using the videoroom plugin together with the streaming plugin but i want some clarification on this.

With the same example above, having “100 publishers who are subscribed to eachother in a room”, i decided to allow each publisher only publish their feed without subscribing to other available feeds in the room using the videoroom plugin under the hood. And then use rtp forward to send the feed to a streaming plugin on another Janus server. On the same publisher’s client, i display the video feeds from the streaming plugin to the publisher ( in other words, each publisher subscribes to the broadcast on the streaming plugin).

  1. Is this approach right?
  2. It seems that each publisher making rtp forward needs a different video port and audio port (streaming room). Do i have to create 100 streaming rooms for each publisher? In that sense i have to create a logic on the client side to assign the streaming room port numbers randmly to different publishers?

Thank you

You only need one Streaming mountpoint (not room) per publisher, since the mountpoint will be the publisher’s “avatar” in the Streaming plugin. So 100 publishers = 100 mountpoints (or more if you’re using more than one Janus instance, and so publishers are duplicated on multiple servers).

What I said about subscribing to 100 people still applies, I don’t think it’s a good idea. Make sure you look into the “switch” request, so that you can reuse existing subscriptions to jump from one publisher to another via pagination. Looking into multistream Streaming mountpoints may be an interesting approach as well. Both us and Digital Samba will make a presentation on this kind of large scale distribution at JanusCon in less than two weeks.

1 Like

Than you so much. And kudos to your wonderful teams. I am getting errors with creating mountpoint per publisher.

error: streaming error received: 455 No such mountpoint/stream 1

this is how i am creating the mountpounts

rtp-mountpoint1: {
type = “rtp”
id = 1
description = “Opus/VP8 live stream coming from external source”
metadata = “You can use this metadata section to put any info you want”
audio = true
video = true
audioport = 5002
audiopt = 111
audiocodec = “opus”
videoport = 5004
videopt = 100
videocodec = “vp8”
secret = “adminpwd”
}

rtp-mountpoint2: {
type = “rtp”
id = 1
description = “Opus/VP8 live stream coming from external source”
metadata = “You can use this metadata section to put any info you want”
audio = true
video = true
audioport = 5006
audiopt = 111
audiocodec = “opus”
videoport = 5008
videopt = 100
videocodec = “vp8”
secret = “adminpwd”
}

Am i missing something? Thanks

Same ID in both mountpoints. Please read the docs more carefully.

That was a terrible mistake on my part. Finally got it working. I created several mountpoints but it seems that the viewer or “subscriber” can only view streams from one mountpoint at a time and just switch between mountpoints to view other streams. Is it possible to view all streams from all mountpoints at the same time?

You need different handles to consume different mountpoints.