mozilla / janus-plugin-sfu

Janus plugin to act as a kind of SFU for game networking data.
Mozilla Public License 2.0
135 stars 39 forks source link

Add a max_sessions option? #84

Open vincentfretin opened 3 years ago

vincentfretin commented 3 years ago

I open this for discussion. This is a point I listed in #76

Since #74 we don't count the users connected via the subscribe message anymore for the max_ccu limit (previously based on sessions and not publishers). To not explode a server with high number of sessions, does it make sense to add another option max_sessions to check the number of sessions? It may be better to add an api join as listener (not publisher), add a list of listeners struct in the switchboard to be able to count them as users for the max_ccu. max_room_size would still be max publishers in a room, it shouldn't count listeners.

vincentfretin commented 3 years ago

Of course one would first tune the event_loops param in janus.jcfg to handle lots of sessions. It seems hubs used event_loops = 128 https://github.com/mozilla/hubs-ops/blob/4a353b156f123262026af3450e8f91b60f9709f5/plans/janus-gateway/habitat/config/janus.cfg#L7 But even with that, the service may be degraded and the audio may become choppy if there are too many sessions on a server I guess? I don't currently have lots of users and didn't do any load testing yet, so I didn't tune event_loops for now.