RTMP Load Testing
This document outlines the steps to perform an RTMP publishing load test on Ant Media Server using the provided script with the help of FFmpeg.
The script simulates a specified number of RTMP live streams published to the Ant Media Server.
Prerequisites
-
A server or virtual machine running Ubuntu 20.04 or later
-
FFmpeg installed on the server
-
The RTMP load test script
Step 1: Downloading the RTMP Load Test Script
-
Open a terminal window on your Ubuntu server or virtual machine.
-
Navigate to the directory where you want to store the RTMP load test script.
-
Run the following command to download the rtmp_publisher.sh script and give it executable permission:
sudo wget https://raw.githubusercontent.com/ant-media/Scripts/master/load-testing/rtmp_publisher.sh && sudo chmod +x rtmp_publisher.sh
Step 2: Running the RTMP Load Test
-
Open a terminal window on your Ubuntu server or virtual machine and go to the directory where you downloaded the
rtmp_publisher.shscript. -
Run the following command to start the RTMP load test:
sudo ./rtmp_publisher.sh /path/to/file.mp4 rtmp://domain-or-Ip/AppName/streamId 10Example command:
sudo ./rtmp_publisher.sh /home/ubuntu/test.mp4 rtmp://rtmp.antmedia.io/LiveApp/test 10This command publishes 10 RTMP streams with stream IDs
test_1,test_2, and so on in the LiveApp application of your Ant Media Server.Replace
file.mp4with the actual MP4 file, update the URL with your Ant Media Server address, and change10to the number of RTMP streams you want to simulate. -
Wait for the test to complete.
-
To stop the RTMP load test, run the following command:
sudo pkill ffmpeg
Similarly, you can increase the number of RTMP streams to simulate higher loads.
RTMP load testing for you
You’ve downloaded the script, started publishing with FFmpeg, and simulated multiple RTMP streams flowing into your Ant Media Server. The dashboard shows the active streams increasing in line with the number you set, confirming that the load test is working.
Now you have a dependable way to validate RTMP publishing performance and ensure your server can handle the desired stream load.