HLS Load Testing
This document outlines the steps to perform an HLS load test on your Ant Media Server using the provided script with the help of FFmpeg.
The script simulates a specified number of HLS viewers accessing a live stream.
Prerequisites
-
A server or virtual machine running Ubuntu 20.04 or later
-
FFmpeg installed on the server
-
The HLS load test script provided
Step 1: Download the HLS Load Test Script
-
Open a terminal window on your Ubuntu server or virtual machine.
-
Navigate to the directory where you want to store the HLS load test script.
-
Use the following command to download the
hls_players.shscript and give it executable permission:sudo wget https://raw.githubusercontent.com/ant-media/Scripts/master/load-testing/hls_players.sh && sudo chmod +x hls_players.sh
Step 2: Running the HLS Load Test
-
Start publishing your live stream. For example, let’s say it has the stream ID
stream1. -
Open a terminal window on your Ubuntu server or virtual machine and go to the directory where you downloaded the
hls_players.shscript. -
Run the following command to start the HLS load test:
sudo ./hls_players.sh https://AMS-Domain:5443/LiveApp/streams/stream1.m3u8 100This command creates 100 HLS viewers for the stream ID stream1 in the LiveApp application of your Ant Media Server.
Replace the URL with the actual URL of your live stream and 100 with the number of HLS viewers you want to simulate.
-
Wait for the test to complete.
-
To stop the HLS load test, use the following command:
sudo pkill ffmpeg
Similarly, you can increase the number of simulated HLS viewers as needed.
HLS load testing for you
You’ve downloaded the script, launched FFmpeg processes, and simulated hundreds of HLS viewers pulling your .m3u8 stream. The Ant Media Server dashboard reflects the increased viewer count, confirming that your load test is running as expected.
Tada — you now have a reliable way to validate HLS performance under real-world viewer loads in Ant Media Server.