How to leverage bare metal for media servers

Bare metal for media server
28 February 2023

One of the most widely known protocols for real-time communication applications is Web Real-Time Communication (WebRTC), an open-source protocol that enables real-time voice, text and video streaming between web browsers and devices. The protocol is designed to supply a seamless and secure communication experience, which is why it has gained widespread popularity in recent years and why many well-known apps we use every single day are built using the protocol.

There are, however, alternatives for WebRTC as a protocol. All obviously have their own pros and cons and are suitable for several types of applications depending on your requirements and constraints.

That said, let’s cover some of the other protocols (read more below):

Table of Contents

Protocols for real-time communication applications

1. Real-Time Messaging Protocol (RTMP)

This is a widely adopted protocol for live-streaming and video conferencing.

2. Secure Reliable Transport (SRT)

This is an open-source video streaming protocol to deliver high-quality and sub-second latency video over unpredictable networks.

3. HTTP Live Streaming (HLS)

Developed by Apple for delivering video and audio over the internet. Supported by many devices and browsers.

4. Real-Time Streaming Protocol (RTSP)

A network control protocol used to control streaming media servers. Widely used for IP camera systems and other surveillance systems.

5. Quick UDP Internet Connections (QUIC)

A relatively new protocol developed by Google, which supplies sub-second latency and multiplexing without head-of-line blocking.

6. Session Initiation Protocol (SIP)

Commonly used protocol for setting up, keeping and ending real-time sessions involving video, voice and other communications between two or more endpoints on IP networks.

This list is not extensive, there are more protocols and standards one can use to build real-time communication applications. Regardless of what protocol you use for your application, the basics we cover in this article are relevant for all protocols, as fundamentally, all protocols benefit from a quality network and bare metal servers for hosting your application. Learn more about the basics of WebRTC and how it works.

Infrastructure for real-time communication applications

For more than two people communicating through WebRTC-based applications. You’ll need compute resources such as bare metal to handle the tasks needed by the protocol. Therefore, you’ll need compute and connectivity services — both come with their caveats, making it crucial for you to understand the role of both and what to look out for when shopping around for your infrastructure needs.

The role of connectivity for RTC applications

Given that the WebRTC protocol forces all users using the application to establish peer-to-peer (P2P) browser connections, it may increase the total bandwidth usage of your application. This may drive up the costs of the infrastructure needed for hosting your application — something to be mindful of.

Aside from the cost of bandwidth usage, you’re looking for a reliable connection with minimal jitter. We’ve all been in plenty of video and voice calls over the past years to understand how a connection dropping can affect your presentation, or how annoying it can be when users drop mid-sentence. Reliability is the most important thing with WebRTC applications, making connectivity a crucial aspect for the infrastructure you select for your application.

The role of compute for RTC applications

It’s quite simple, you need compute resources to host WebRTC servers. However, depending on your setup, the importance of compute may vary. If you’ve built a simple voice application, you can get away with simple resources. However, there’s plenty of applications out there that require powerful servers with GPU cards to process video and its distribution. Both may affect costs as well as performance, which one way or another ends up affecting the experience of the user of your application.

Considering both compute and connectivity limitations and implications for your applications, it is therefore crucial to achieve a cost-effective solution while keeping a prominent level of quality for your application.

WebRTC server types

There are four distinct types of WebRTC servers, all with their own purpose.

1. WebRTC application server

This application server is nothing more than an application and website hosting server. It is like hosting a website, nothing more to it.

2. WebRTC signaling server

This server simply manages the connections between your users’ devices, starting calls, closing calls, and managing the connection. Orchestration is the only functionality of the WebRTC signaling server, it does not touch the actual media traffic itself.

3. NAT traversal WebRTC servers

When using a Network address translation (NAT) traversal for WebRTC, the types of servers used can be categorized into two types: Session Traversal Utilities for NAT (STUN) and Traversal Using Relays around NAT (TURN). Both serve the purpose of bypassing firewalls and NAT devices to establish a peer-to-peer connection between devices behind these security measures. However, their methods of operation differ. During a typical WebRTC call, the STUN server obtains the public IP of each device involved and uses it to direct call data through the firewall and NAT.

4. WebRTC media server

A WebRTC media server is a form of multimedia ‘middleware’ that acts as a mediator between communicating peers. It eases the transfer of media traffic from the source to its destination. These servers supply various functions such as stream processing, group communication, media mixing, transcoding, and recording, among others. For instance, they can act as a Multi-Conference Unit (MCU) by distributing media streams from peers to multiple receivers. They can also mix multiple incoming streams into a single composite stream, transcoding between incompatible codecs and formats, and store media exchanges permanently.

Media servers are therefore optional — if your application only handles communication between two people, you don’t need a media server. But as soon as you’re handling conference calls, group calls, streaming, recording, and broadcasting, a media server is essential.

Due to the WebRTC media server serving most of the traffic and doing (in some cases) the heavy lifting when it comes to processing, media servers are the core of where you can make your WebRTC application more efficient when it comes to costs and quality.

We explain more about the different server types in our blog WebRTC Servers Explained: Ultimate Guide.

What to look out for when selecting an infrastructure provider

The compute resources needed for WebRTC facilitate real-time communication between browsers and other connected devices, handling the signaling, media transmission and data transfers between, to and from users. What you’re looking for in an infrastructure provider is to supply a secure, reliable, and scalable solution.

When selecting infrastructure providers for the distinct types of WebRTC servers it is crucial to consider the actual purpose of the server. For example, WebRTC media servers have a different use case, different requirements and use more bandwidth than, for example, application servers so decide your infrastructure strategy accordingly. If you’re not using a Software as a service (SaaS) or Communications Platform as a Service (CPaaS) provider and need to go shopping for infrastructure providers yourself, here are a few pointers on what to look out for:

1. Network quality

Jitter, latency, and packet loss may kill the experience for your users to communicate with each other properly. The network, how it is designed, managed, and monitored is a crucial part of its service.

Some stuff you want to double check:

1.1 Test network quality with a looking glass tool

This should be an obvious decision, but always run a live Proof of concept (PoC) to thoroughly test the network. Yes, a tool such as the Looking Glass provides you with relevant information, but you will need to test it over a period before signing a contract. 

1.2 Check both the physical and network presence of your provider

Look for a provider with global presence, however, don’t steer blindly by only counting its physical locations. The internet is routed through physical cables, and sure, there are plenty of software tweaks to improve quality but at the end of the day, we’re talking about two factors: 

Figure out which ISPs (Internet Service Providers) your customers use in their markets and check whether the infrastructure provider of your choice can reach those providers without scenic routing.

2. Scalability

If your application scales up, so should your infrastructure. There are various tools to ensure your infrastructure is scalable, whether you build your own backend and leverage infrastructure as code (IAC) such as Terraform to scale. Leverage containers to easily deploy like K8s. Whatever it is, make sure it scales. It doesn’t matter whether it is Bare Metal or cloud, both scales easily, but both need some love to make sure they scale as you want them to. Ensure your infrastructure strategy reflects this.

3. Cost-Effectiveness

WebRTC servers, especially media servers, have high bandwidth demands, while some other applications require high processing power. Both can become costly, especially with egress charges if your egress is petabytes. It will pay off to investigate all the costs, including egress costs, and model them over your expected usage to figure out what the costs will be eventually. You don’t want to be paying more when your application scales up and realize that migrating to another provider will be a prompt expense in which you want your engineers to build new features—not migrating for the sake of cost-savings.

4. DDoS protection for media server

There are several reasons why an Anti-DDoS application should be on your radar. Here are three reasons why you should be protecting your media servers properly.

4.1 High bandwidth usage

As WebRTC involves real-time streaming of audio and video data, media servers use a lot of bandwidth. As media servers act as a relay for the data they may be an attractive target for attackers, creating a bottleneck in your network and disrupting communication.

4.2 Publicly accessible

In some applications media servers are publicly accessible, meaning they can be accessed by anyone with an internet connection which makes them an easy target.

4.3 Critical to the service

Media servers are critical to the functioning of a real-time communication application. If the media server becomes unavailable or unresponsive it can disrupt communication, making your services unusable.
Deciding your hosting strategy for a real-time communication application is not to be taken lightly. It is at the core of your application’s uptime, as without a proper strategy it may disrupt your user’s communication. Regardless of what protocol you use, what type of servers you use and whether you manage the infrastructure yourself or through a SaaS/CPaaS provider, investigate properly to ensure you don’t get affected by downtime, unexpected excessive costs, or other risks when your application starts attracting an increased number of users.
Main Take-Aways
Infrastructure is mission-critical to the success of your RTC application. By incorporating the right infrastructure strategies, you can unleash the potential of the best user experience, the best compute performance and controlling costs.
This site is registered on as a development site. Switch to a production site key to remove this banner.