# Improving Optimization in a Conference Meeting

**URL:** <https://mediasoup.discourse.group/t/improving-optimization-in-a-conference-meeting/5483>\
**Category:** mediasoup libraries\
**Created:** [September 6, 2023, 3:00am UTC](https://mediasoup.discourse.group/t/improving-optimization-in-a-conference-meeting/5483 "2023-09-06T03:00:26Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![dikyardiyanto17](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@dikyardiyanto17](https://mediasoup.discourse.group/u/dikyardiyanto17)\
**Post date:** [September 6, 2023, 3:00am UTC](https://mediasoup.discourse.group/t/improving-optimization-in-a-conference-meeting/5483/1 "2023-09-06T03:00:26Z")

</div>

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 :

> [@1 receiver transport per client or 1 receiver transport per stream](https://mediasoup.discourse.group/t/1-receiver-transport-per-client-or-1-receiver-transport-per-stream/4019/10):
>
> **I am answering here to my own question:**  
> After experimenting on it for around a week the final conclusion is that using 1 receiver transport per client causes video lag and after few minutes leads to streams being ended especially on average network and by average I mean 10-15 mbps.
> 
> **The solution is to use 1 receiver transport per stream or 1 receiver transport for 2-5 streams may be** e.g I use 1 receiver transport per remote person in call, 1 remote person’s camera stream and screen stream both are consumed on that 1 receiver transport. This gives best results.

Thank you.

---

<div class="post-metadata">

**Author:** ![zaidiqbal](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/zaidiqbal/32/1498_2.png) [@zaidiqbal](https://mediasoup.discourse.group/u/zaidiqbal)\
**Post date:** [September 6, 2023, 5:26am UTC](https://mediasoup.discourse.group/t/improving-optimization-in-a-conference-meeting/5483/2 "2023-09-06T05:26:58Z")

</div>

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:

> [@Downside of using one transport for only one producer/consumer?](https://mediasoup.discourse.group/t/downside-of-using-one-transport-for-only-one-producer-consumer/5057):
>
> Hi, I am using one transport for one producer/consumer for some of the scalability reasons on my server side and I want to stick to that. It is mentioned in some topics that it is better to have all producers on single transport because bandwidth estimation is better in that case and I think same goes for consumers as well. I want to ask if there is any downsides to using one transport for one producer/consumer? If yes then how much difference in bandwidth estimation, performance in percentage…

---

<div class="post-metadata">

**Author:** ![dikyardiyanto17](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@dikyardiyanto17](https://mediasoup.discourse.group/u/dikyardiyanto17)\
**Post date:** [September 6, 2023, 6:46am UTC](https://mediasoup.discourse.group/t/improving-optimization-in-a-conference-meeting/5483/3 "2023-09-06T06:46:24Z")

</div>

> [@zaidiqbal](#):
>
> This is deeply explored here:
> 
> > [@](#):
> >
> > Hi, I am using one transport for one producer/consumer for some of the scalability reasons on my server side and I want to stick to that. It is mentioned in some topics that it is better to have all producers on single transport because bandwidth estimation is better in that case and I think same goes for consumers as well. I want to ask if there is any downsides to using one transport for one producer/consumer? If yes then how much difference in bandwidth estimation, performance in percentage…

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

---

<div class="post-metadata">

**Author:** ![zaidiqbal](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/zaidiqbal/32/1498_2.png) [@zaidiqbal](https://mediasoup.discourse.group/u/zaidiqbal)\
**Post date:** [September 6, 2023, 6:50am UTC](https://mediasoup.discourse.group/t/improving-optimization-in-a-conference-meeting/5483/4 "2023-09-06T06:50:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![dikyardiyanto17](https://avatars.discourse-cdn.com/v4/letter/d/df788c/32.png) [@dikyardiyanto17](https://mediasoup.discourse.group/u/dikyardiyanto17)\
**Post date:** [September 6, 2023, 6:54am UTC](https://mediasoup.discourse.group/t/improving-optimization-in-a-conference-meeting/5483/5 "2023-09-06T06:54:07Z")

</div>

I see, thank you for your thought.
