# Advantages of WebRtcServer over the "old way"

**URL:** <https://mediasoup.discourse.group/t/advantages-of-webrtcserver-over-the-old-way/4537>\
**Category:** mediasoup libraries\
**Created:** [September 7, 2022, 8:21am UTC](https://mediasoup.discourse.group/t/advantages-of-webrtcserver-over-the-old-way/4537 "2022-09-07T08:21:57Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kaplan](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/kaplan/32/1116_2.png) [@Kaplan](https://mediasoup.discourse.group/u/Kaplan)\
**Post date:** [September 7, 2022, 8:21am UTC](https://mediasoup.discourse.group/t/advantages-of-webrtcserver-over-the-old-way/4537/1 "2022-09-07T08:21:57Z")

</div>

Hi there, I was wondering if anybody can share real life experiences of improvements (if any) of using the new WebRtcServer with a single port per worker over the previous way? I was reading the threads in this group and some alluded to performance advantages of reading from the single port vs multiple random ports. Are there any drawbacks for moving to WebRtcServer?  
Thanks!

---

<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:** [September 7, 2022, 8:49am UTC](https://mediasoup.discourse.group/t/advantages-of-webrtcserver-over-the-old-way/4537/2 "2022-09-07T08:49:46Z")

</div>

You need to open less public ports in your server if you use WebRtcServer. No drawbacks at all.

---

<div class="post-metadata">

**Author:** ![Kaplan](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/kaplan/32/1116_2.png) [@Kaplan](https://mediasoup.discourse.group/u/Kaplan)\
**Post date:** [September 7, 2022, 10:43am UTC](https://mediasoup.discourse.group/t/advantages-of-webrtcserver-over-the-old-way/4537/3 "2022-09-07T10:43:02Z")

</div>

Thats it? no performance gain? what about local port usage? for example we do a lot recording and that takes a few ports, sometimes there is local port collision, would this help there? thanks!

---

<div class="post-metadata">

**Author:** ![BronzedBroth](https://avatars.discourse-cdn.com/v4/letter/b/ad7895/32.png) [@BronzedBroth](https://mediasoup.discourse.group/u/BronzedBroth)\
**Post date:** [September 7, 2022, 11:22am UTC](https://mediasoup.discourse.group/t/advantages-of-webrtcserver-over-the-old-way/4537/4 "2022-09-07T11:22:35Z")

</div>

> [@Kaplan](#):
>
> Thats it? no performance gain?

Transports are still handled the same way, just port binding is shared. CPU usage will be the same.

> [@Kaplan](#):
>
> sometimes there is local port collision, would this help there? thanks!

This is just a convenience, you’d still be utilizing a range to some extent if this were a multi-core server, so for collision you’ll need to be a bit better with the programming to avoid that.

It’d be much more easier when running many instances to have the single port collide.

---

<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:** [September 7, 2022, 11:25am UTC](https://mediasoup.discourse.group/t/advantages-of-webrtcserver-over-the-old-way/4537/5 "2022-09-07T11:25:28Z")

</div>

There is some performance gain because many UDP packets can be received together by a single UV read call, but it’s not something huge.

Local port usage: this is just for WebRTC connections, WebRtcServer doesn’t work for plain RTP since it depends on ICE to identify client transports.

Anyway: main purpose of WebRtcServer is to minimize the number of ports that needs to be publicly open, specially important when using AWS or Google Cloud (internal NAT with public port mapping etc).

---

<div class="post-metadata">

**Author:** ![alexciarlillo](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/alexciarlillo/32/131_2.png) [@alexciarlillo](https://mediasoup.discourse.group/u/alexciarlillo)\
**Post date:** [September 13, 2022, 2:32pm UTC](https://mediasoup.discourse.group/t/advantages-of-webrtcserver-over-the-old-way/4537/6 "2022-09-13T14:32:36Z")

</div>

The biggest advantage for us was that it opened up the opportunity to use AWS Global Accelerator since we have a much smaller port range to cover. Prior to this the port range to support enough users was too large to feasibly use a single global accelerator listener with many backend servers.

---

<div class="post-metadata">

**Author:** ![jason-shen](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/jason-shen/32/1419_2.png) [@jason-shen](https://mediasoup.discourse.group/u/jason-shen)\
**Post date:** [September 14, 2022, 4:21am UTC](https://mediasoup.discourse.group/t/advantages-of-webrtcserver-over-the-old-way/4537/7 "2022-09-14T04:21:58Z")

</div>

question on the side when using createPipeTransport with webrtcServer, does that still require certain amount of ports open?

thanks advanced

---

<div class="post-metadata">

**Author:** ![jbaudanza](https://yyz2.discourse-cdn.com/free1/user_avatar/mediasoup.discourse.group/jbaudanza/32/1996_2.png) [@jbaudanza](https://mediasoup.discourse.group/u/jbaudanza)\
**Post date:** [September 27, 2022, 11:47am UTC](https://mediasoup.discourse.group/t/advantages-of-webrtcserver-over-the-old-way/4537/8 "2022-09-27T11:47:44Z")

</div>

> [@alexciarlillo](#):
>
> The biggest advantage for us was that it opened up the opportunity to use AWS Global Accelerator

@alexciarlillo If you have time, I would love to hear more about your experience with Global Accelerator. Specifically, how did you architect this? Do all producers in a room route through global accelerator to the same mediasoup instance? Did you find this improved latency/packetloss/jitter/etc?
