Scaling Amazon IVS for High-Volume Streaming
In this blog post, we'll explore the intricacies of scaling Amazon Interactive Video Service (AWS IVS) to handle high-volume streaming scenarios. As live streaming continues to grow in popularity across industries, from gaming and sports to virtual events and e-learning, the need for robust, scalable solutions has never been greater.
Najib Muhammad Kado
Amazon Employee
Published Nov 14, 2024
Live streaming is quickly becoming the go-to medium for reaching audiences in real time, but scaling live streams to hundreds or even thousands of channels can be a complex challenge. Recently, I worked on a project where I had to create multiple live streams and simulate large-scale viewership using AWS Interactive Video Service (IVS). In this blog post, I’ll walk you through the process of setting up multiple IVS channels, automating video streaming with Python, and scaling up to 1000 channels, all while testing the platform’s ability to handle multiple viewers simultaneously.
AWS IVS is a fully managed service for live streaming, enabling you to stream low-latency video content at scale. With IVS, you don’t have to worry about managing servers, handling load balancers, or dealing with complex setups for delivering content to viewers.
My goal was to:
- Create a UGC platform demo using AWS IVS.
- Show that AWS IVS can simultaneously handle 1000 live channels.
- Test how AWS IVS handles the stress of managing both the live streams and the viewership load.
- Deploying an existing UGC application from AWS-Samples:
To setup a demo for UGC, I leveraged Todd Sharp's StreamCat, A UGC application built on AWS IVS to show how AWS IVS works. I wouldn't be going into details about this section as you can read from Todds blog post here and you can find the github repo here
- Show that AWS IVS can simultaneously handle 1000 live channels
So to achieve this, I decided to take a different approach, since i don't have the cameras to stream live content, I said to myself, why not stream a prerecorded video, and that is exactly what i did. So I automated this entire process using the following:
- Python for creating and managing channels.
- FFmpeg for streaming pre-recorded video content to AWS IVS.
- Boto3 (AWS SDK) to interact with AWS services.
The Script:
The core of this process involved scripting the creation of channels and automating the streaming process. You will find the complete code to the python script here, however below is the core function used for streaming the prerecorded video to the channels:
Streaming Video to AWS IVS
I used FFmpeg to stream pre-recorded content to each channel. Each IVS channel is assigned a unique stream key and ingest endpoint, and the script automatically handles these values for each channel, streaming content simultaneously across multiple channels.
The Results: IVS at Scale
After writing the script, I ran it on an EC2 instance to test out a few channels. Everything was working as expected, and I decided to use a short football video clip I downloaded online to stream to 9 channels. Why 9 channels? Well, it just happens to be my lucky number!
With everything set up, I deployed the Amazon IVS QoS Dashboard to monitor real-time insights on how the channels were performing. Afterward, I ran the script again to verify that everything was functioning correctly before scaling up to test with a thousand channels.
Finally, now that i have everything setup, it's time to stream a prerecorded video to a thousand channels, so I deployed a larger EC2 instance that is optimized for video streaming, and ran my script, however I made some adjustments to the script, instead of limiting it to a certain number of channels, I decided to let it stream to all available channels in the region.
This demo proved that AWS IVS can handle 1000 live channels simultaneously with thousands of viewers across all streams. The combination of AWS IVS, Python automation, FFmpeg for streaming, and EC2 scaling makes it possible to achieve large-scale live-streaming success.
Whether you’re hosting live events, gaming streams, or educational content, AWS IVS has the scalability and reliability to meet your needs. If you’re building a live-streaming platform, IVS should be your go-to service for delivering real-time, low-latency video content at any scale.
Any opinions in this post are those of the individual author and may not reflect the opinions of AWS.