Try Live Demo

Live streaming has become a popular medium for content delivery, enabling real-time engagement with audiences across the globe.

Whether it’s broadcasting live events, webinars, or interactive video chats, the seamless and uninterrupted streaming experience is crucial for both content creators and viewers. That’s where the concept of high availability comes into play.

In the world of live streaming, high availability refers to the ability of a streaming solution to deliver content continuously, without any interruptions or downtime. It ensures that viewers can access the stream at any given moment, regardless of the underlying infrastructure or potential technical issues.

In this blog post, we’ll look at high availability for live streaming and how Ant Media Server offers uninterrupted streaming experiences for both broadcasters and viewers.

Ant Media Server includes powerful features and techniques that are meant to reduce downtime, increase scalability, and optimize the whole streaming workflow.

Discover the potential of high availability with Ant Media Server and how it transforms the live streaming scene.

Note: Ant Media Server v2.6.1 and later supports high availability implementation.

Deploying a High Availability Cluster with Ant Media Server

High Availability Cluster with Ant Media Server

When it comes to building a high availability streaming environment, Ant Media Server offers multiple deployment options through its clustering feature.

Whether you prefer cloud-based solutions or on-premises deployments, Ant Media Server supports a wide range of platforms, including Amazon Web Services (AWS), Microsoft Azure, and more.

By referring to the Clustering and Scaling documentation, you can find detailed information on how to set up and configure a cluster based on your specific requirements.

Please also see the Ant Media Server cluster deployment blog on Kubernetes using Helm.

What scenarios require high availability?

To keep things simple, the below scenarios use two Ant Media Server instances behind a load balancer. 

The goal is to demonstrate automatic instance switching when one of the instances goes down during the publishing or playing of a live stream.

Scenario 1

In this first scenario, we’ll look at how high availability supports both playback and publishing when an instance fails or when an instance experiences an unexpected shut down. 

Start by following these steps. 

  1. Create a load balancer and two instances in cluster mode
  2. Publish a live stream on instance1 through the load balancer
  3. Play the stream on instance2 through the load balancer
  4. Now stop the service on instance2

Result: Now that Ant Media Server on instance2 has been shut down, the player that was started at step 3 on instance2 should start to play through instance1 automatically. 

Now lets see how live stream publishing can support high availability. Continue with the next steps below:

  1. Start instance2
  2. Stop the service on instance1

Result: The live broadcast that was started at step 2 which was publishing to instance1 will start to publish to instance2 and and the player started at step 3 will play automatically.

Scenario 2: 

This scenario looks at when your servers encounter high CPU usage and fail to process the live stream. 

In some cases, when the load is too high, the live stream keeps attempting to connect, but fails. However, with more than one instance up and running, there is more opportunity for the live broadcast to reconnect. 

Start by following the below steps.

  1. Create a load balancer and two instances in cluster mode
  2. Set the CPU limit to 30 on instance1 and instance2
  3. Increase the CPU usage to 50 by running some tasks from the terminal on both instance1 and instance2
  4. Publish a live stream on instance1 through the load balancer

Result: The broadcast that was started at step 4 will try to publish periodically but it will not succeed

  1. Stop running the load operation on instance2 to decrease the CPU usage.

Result:  The live stream that was started will now start to publish to instance2

  1. Increase the CPU load on instance2 to 50
  2. Play the live stream

Result:  The player on step 7 will try to play periodically but it will not succeed

  1. Stop running the load operation on instance2 to decrease the CPU usage.

Result: The player on step 8 will start to play the live stream

Conclusion

As you can see, Ant Media Server supports high availability in multiple scenarios. Once configured, you can be sure that your live streams are up and running with as little interruption as possible. 

Video Demonstration of High Availability

For the quick demonstration of high availability with Ant Media Server, you can watch the video below.

Also check the scaling with Ant Media Server on AWS EKS here.

Where now?

Explore the documentation or join the community discussions to learn more about the Ant Media Server.

Demos of Ant Media Server are available on the website and you can check out some of the popular SDKs in Github to integrate Ant Media Server into your mobile application.

Deployment options include 1-click apps, cloud marketplaces, Docker/Kubernetes/Scripts on various cloud providers such as AWS, Microsoft Azure, Digital Ocean, Linode, and Alibaba.

A free trial is available to try out the Enterprise Edition of the product and support packages are available for both editions if you need some extra help getting started.

Categories: Tutorial

Yash Tandon

Yash is a experienced Technical Support Engineer at Ant Media with a robust background in troubleshooting and optimizing technical systems. Proficient in a diverse array of technologies, including AWS, Docker, Kubernetes, Python and Shell scripting, Selenium, etc. Additionally, well-versed in media technologies such as RTMP, HLS, VOD, WebRTC, and Live Streaming tools.

chatsimple
Warning: Undefined array key "promocode" in /home/mirror.antmedia.io/public_html/wp-content/themes/hestia-child/footer.php on line 70