Improving Optimization in a Conference Meeting

Hello everyone,

I have successfully created a conference meeting system utilizing four cores and optimizing it by employing different workers for a more efficient approach. Now, I am trying to optimize and gain a deeper understanding of mediasoup by delving into the documentation and engaging in discussions.

I have a question after reading the documentation and discussions, Is it advisable for all producers to share a single transport? For instance, in a scenario where I have 100 users online, each in separate rooms with 10 users per room (totaling 10 rooms), and I collect their streams in one transport, how might this affect CPU usage? Currently, I’m using one transport per producer/consumer but I am considering changing to one transport for all producers and one transport consumer per client (for audio and video streams) for a potentially better approach?

reference :

Thank you.

1 Like

Transports do bandwidth estimations etc to adapt to the network conditions. Multiple transports means more calculations per transport which means more CPU. But the CPU increase is not much.

→ Using one transport for all producers in recommended but not compulsory.
→ Same is true for consumers as well but as consumers are more in numbers so usually we divide them over multiple transports like all consumers of one participant on one transport or 10 consumer per transport etc. But you can still have them on one transport no matter how many they are, it is totally possible.

At the end it is up to you how you want to do it. I personally use one transport for one producer, consumer. It helps me with the scalability on server side but that is my own logic yours can be different.

Another approach can be that you use one transport for all producers but for consumers you can use one transport per participant like share screen, video , audio of one participant goes under one transport.

There can be many other approaches.

This is deeply explored here:

1 Like

Thank you, I’ve read through this discussion and wanted to confirm my thoughts.
I have another question: Is it recommended to save producer and consumer transport data to a database like PostgreSQL or MongoDB, or should I handle it solely on the server? I’m using Node.js, by the way

I don’t think saving producers, consumers data to database is needed. I use nodejs and save room related information, participants list, socket ids, etc in redis. Never needed to store producers, consumers in db, they are managed locally and whenever server gets restarted everything like transports, producers, consumers are destroyed, even if you save them in db they will be of no use.

If you want to save the ids of producers, consumers for reference during the call temporarily you can save them in redis.

1 Like

I see, thank you for your thought.

1 Like