# increase number of consumers in mediasoup-demo

**URL:** <https://mediasoup.discourse.group/t/increase-number-of-consumers-in-mediasoup-demo/1825>\
**Category:** mediasoup-demo\
**Created:** [October 1, 2020, 12:48pm UTC](https://mediasoup.discourse.group/t/increase-number-of-consumers-in-mediasoup-demo/1825 "2020-10-01T12:48:53Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![AliEsmailpor](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/aliesmailpor/32/783_2.png) [@AliEsmailpor](https://mediasoup.discourse.group/u/AliEsmailpor)\
**Post date:** [October 1, 2020, 12:48pm UTC](https://mediasoup.discourse.group/t/increase-number-of-consumers-in-mediasoup-demo/1825/1 "2020-10-01T12:48:53Z")

</div>

Hi,  
I’m working on a Online class App. This is the scenario:  
I have a teacher and 30 students.  
I have changed Room.js of mediasoup-demo server and made it like this:

1. Teacher can consume all student if he wants. (at the first when students connect they all silence).
2. Teacher can produce.
3. Students can consume teacher.
4. Students can produce himself if teacher wants.(at the first when students connect they all silence).  
I have to mention that I do not want to have all student’s video and audio. JUST one of them or two.  
It’s working fine now, but I have a problem ☹  
Assume 3 students already joined. When the fourth student wants to connect, one of students loses teacher’s video and audio immediately.  
How can I fix it?  
I mean, there is no limitation here? Maybe I made a mistake somewhere.

---

<div class="post-metadata">

**Author:** ![ibc](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/ibc/32/1540_2.png) [@ibc](https://mediasoup.discourse.group/u/ibc)\
**Post date:** [October 1, 2020, 1:39pm UTC](https://mediasoup.discourse.group/t/increase-number-of-consumers-in-mediasoup-demo/1825/2 "2020-10-01T13:39:13Z")

</div>

That’s a bug in your code. No limitation here.

---

<div class="post-metadata">

**Author:** ![AliEsmailpor](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/aliesmailpor/32/783_2.png) [@AliEsmailpor](https://mediasoup.discourse.group/u/AliEsmailpor)\
**Post date:** [October 2, 2020, 6:54pm UTC](https://mediasoup.discourse.group/t/increase-number-of-consumers-in-mediasoup-demo/1825/3 "2020-10-02T18:54:35Z")

</div>

Thank you.  
Yes that was my bad.  
Another question. When 5 or 6 people are connected everything is OK and my send speed is about 1.5Mbs. But when it increases to more than 15 users my send speed goes down and reach to 200-300 Kbs. Why?  
In addition I have to say all users’s webcam and mic are disabled and when I need, I made them resume.  
My server is Ubuntu and has 4CPU and 8G RAM.  
Like the previous one I made mistake somewhere 🙂?

---

<div class="post-metadata">

**Author:** ![AliEsmailpor](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/aliesmailpor/32/783_2.png) [@AliEsmailpor](https://mediasoup.discourse.group/u/AliEsmailpor)\
**Post date:** [October 4, 2020, 8:20am UTC](https://mediasoup.discourse.group/t/increase-number-of-consumers-in-mediasoup-demo/1825/4 "2020-10-04T08:20:27Z")

</div>

You think something is wrong with my server’s bandwidth? If I got this I can change my server. Please help me. Thank you.

---

<div class="post-metadata">

**Author:** ![AliEsmailpor](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/aliesmailpor/32/783_2.png) [@AliEsmailpor](https://mediasoup.discourse.group/u/AliEsmailpor)\
**Post date:** [October 4, 2020, 3:37pm UTC](https://mediasoup.discourse.group/t/increase-number-of-consumers-in-mediasoup-demo/1825/5 "2020-10-04T15:37:12Z")

</div>

I found that it was my network issue that sometimes it happens. But when internet got better my uplink never went back, at all. I have to refresh the page.  
What should I have to do?

---

<div class="post-metadata">

**Author:** ![AliEsmailpor](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/aliesmailpor/32/783_2.png) [@AliEsmailpor](https://mediasoup.discourse.group/u/AliEsmailpor)\
**Post date:** [October 5, 2020, 12:03pm UTC](https://mediasoup.discourse.group/t/increase-number-of-consumers-in-mediasoup-demo/1825/6 "2020-10-05T12:03:54Z")

</div>

When the uplink drops down I disable and enable the webcam with this code:

```auto
await roomClient.disableWebcam();
await roomClient.enableWebcam();

```

and after that producer uplink gets better like when we started and the consumer’s video gets a quick blink. I know I made a mistake somewhere in configuration and I have no idea.  
Or there is a way to update “sendTransport.produce”?

---

<div class="post-metadata">

**Author:** ![AliEsmailpor](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/aliesmailpor/32/783_2.png) [@AliEsmailpor](https://mediasoup.discourse.group/u/AliEsmailpor)\
**Post date:** [October 6, 2020, 4:30pm UTC](https://mediasoup.discourse.group/t/increase-number-of-consumers-in-mediasoup-demo/1825/7 "2020-10-06T16:30:30Z")

</div>

I disabled Simulcast, everything is OK now and I’m so happy. 🙂  
Thank you for everything.

---

<div class="post-metadata">

**Author:** ![akindizayn](https://avatars.discourse-cdn.com/v4/letter/a/dec6dc/32.png) [@akindizayn](https://mediasoup.discourse.group/u/akindizayn)\
**Post date:** [October 7, 2020, 7:05pm UTC](https://mediasoup.discourse.group/t/increase-number-of-consumers-in-mediasoup-demo/1825/8 "2020-10-07T19:05:50Z")

</div>

Hello, the script you created is a really good idea. Can you share these codes for my students too? We can also make improvements and share them with you. Thanks
