AWS Wavelength is an inspiring technology provided by Amazon to applications that require ultra-low latency on the network and we will explain in this blog post how Ant Media Server should be configured in the AWS Wavelength zone to achieve milliseconds latency. As you all know, Ant Media Server is a highly scalable ultra-low latency WebRTC Server that provides sub-second latency normally and the latency can be decreased under 150 milliseconds with the conditions provided within AWS Wavelength.
AWS Wavelength zones are isolated from the public internet and this requires some adaptations in order to run Ant Media Server successfully. Therefore, the Ant Media DevOps team created a solution to enable Ant Media Server to run on AWS Wavelength. Moreover, the CloudFormation file was also prepared as templated to make such a cluster installation in the simplest and fastest way possible.
In this post, we will only focus on the components and installation of the Ant Media Server Cluster in the AWS Wavelength zone. Please also keep in mind that you can achieve the installation and configuration automatically with the help of provided CloudFormation files therefore if you want to learn details you can jump to the Ant Media Server Cluster Installation section directly. In addition to that, if you want to learn more about the Ant Media Server cluster itself, you can always refer to information from this address.
Here are the topics that we will touch base on this post:
- What is AWS Wavelength?
- Free STUN Servers on AWS Wavelength For You
- Easy SSL Installation in Wavelength
- Make your Standalone Ant Media Server Ready in Minutes
- One-Click Auto-Scalable Ant Media Server Cluster Deployment with CloudFormation
What is AWS Wavelength?
AWS Wavelength is an inspiring technology provided by Amazon for applications that require ultra-low latency on the network. AWS defines it as “AWS Wavelength enables developers to build applications that deliver ultra-low latencies to mobile devices and end-users. Wavelength deploys standard AWS compute and storage services to the edge of telecommunication carriers’ 5G networks.”
You can find more about it here.
Free STUN Servers on AWS Wavelength For You
Ant Media provides two STUN Servers already deployed and free to use in AWS Wavelength zone. One of them is located in Boston and the other one is located in Oregon.
You can directly access them anytime from stun.wavelength.antmedia.cloud address.
The alternative way is to build your own STUN server if preferred. You can learn how to configure your own STUN server from this document. The easier method is to use the ClouldFormation template to create a STUN Server.
Easy SSL Installation in Wavelength
Since AWS Wavelength is not fully accessible by the public internet, we could not create certificates by using the Letsencrypt HTTP-01 challenge. In order to overcome this, we’ve decided to use the DNS-01 challenge to create an SSL certificate through DNS. You can easily access SSL installation documents for Route53 or other DNS from these documents in here.
Make your Standalone Ant Media Server Ready in Minutes
You may use Ant Media Server in standalone (single instance) mode if the load can be handled by a single server in your application. For such cases, we created a CloudFormation file beside the CloudFormation file for a cluster installation. You can easily create a standalone AMS instance from the AMS AMI in the marketplace by using this template.
One-Click Auto-Scalable Ant Media Server Cluster Deployment with CloudFormation
If the single instance is not enough to handle the streaming load in your application then you need to have an AMS cluster. To distribute the load to AMS instances you also need to have a load balancer. Since Elastic Load Balancer (ELB) is not available on the AWS Wavelength zone, we created a solution by using Nginx as a load balancer. We installed two Nginx servers in active and passive mode. We simplified all this Cluster installation with a CloudFormation template.
Summary
As you all know, Ant Media Server is a highly scalable ultra-low latency WebRTC Server which provides sub-second latency. After following up above provided instructions and starting to use Ant Media Server, you can reach under 150 milliseconds latency with the excellent network conditions provided by AWS Wavelength.