Skip to content

Commit

Permalink
Merge pull request #335 from ant-media/rtmp-srt-load-test-docs
Browse files Browse the repository at this point in the history
Create rtmp-load-testing.md
  • Loading branch information
Mohit-3196 authored Aug 30, 2024
2 parents cd79c3d + fce4477 commit 556b416
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 2 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
---
title: RTMP Load Testing
description: A simple guide to making a RTMP load test on your Ant Media Server.
keywords: [Ant Media Load Testing, RTMP load test, Ant Media Server Documentation, Ant Media Server Tutorials]
sidebar_position: 3
---

This document outlines the steps to perform a RTMP publishing load test on Ant Media Server using the provided script with the help of ffmpeg.

The script will simulate a specified number of RTMP live streams published to the Ant Media Server.

## Prerequisites

- Server or virtual machine running Ubuntu 20.04 or later.
- FFMPEG installed on the server.
- RTMP load test script

### Step 1: Download 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.
- Use the following command to download the `rtmp_publisher.sh` script and give it executable permission:

```bash
sudo wget https://raw.githubusercontent.com/ant-media/Scripts/master/load-testing/rtmp_publisher.sh && sudo chmod +x rtmp_publisher.sh
```

### Step 2: Run the RTMP Load Test

- Open a terminal window on your Ubuntu server or virtual machine and go to the directory where you have downloaded the `rtmp_publisher.sh` script.
- Use the following command to start the RTMP load test:

```bash
sudo ./rtmp_publisher.sh /path/to/file.mp4 rtmp://domain-or-Ip/AppName/streamId 10
```

Here is the sample command:

```bash
sudo ./rtmp_publisher.sh /home/ubuntu/test.mp4 rtmp://rtmp.antmedia.io/LiveApp/test 10
```

This command will publish 10 RTMP streams with stream IDs `test_1`, `test_2` etc. in the LiveApp application of your Ant Media Server.

Replace `file.mp4` with the actual mp4 file, the URL with the actual URL of your Ant Media Server and `10` with the number of RTMP streams you want to simulate.

- Wait for the test to be completed.
- Use the following command to stop the HLS load test:

```bash
sudo pkill ffmpeg
```

Similarly, you can increase the RTMP streams load count as needed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: SRT Load Testing
description: A simple guide to making a SRT load test on your Ant Media Server.
keywords: [Ant Media Load Testing, SRT load test, Ant Media Server Documentation, Ant Media Server Tutorials]
sidebar_position: 4
---

This document outlines the steps to perform a SRT publishing load test on Ant Media Server using the provided script with the help of FFMPEG.

The script will simulate a specified number of SRT live streams published to the Ant Media Server.

## Prerequisites

- Server or virtual machine running Ubuntu 20.04 or later.
- FFMPEG installed on the server.
- SRT load test script

### Step 1: Download the SRT Load Test Script

- Open a terminal window on your Ubuntu server or virtual machine .
- Navigate to the directory where you want to store the SRT load test script.
- Use the following command to download the `srt_publisher.sh` script and give it executable permission:

```bash
sudo wget https://raw.githubusercontent.com/ant-media/Scripts/master/load-testing/srt_publisher.sh && sudo chmod +x srt_publisher.sh
```

### Step 2: Run the SRT Load Test

- Open a terminal window on your Ubuntu server or virtual machine and go to the directory where you have downloaded the `srt_publisher.sh` script.
- Use the following command to start the SRT load test:
```bash
sudo ./srt_publisher.sh /path/to/file.mp4 srt://domain-or-IP:4200?streamid=AppName/streamId 10
```

Here is the sample command:

```bash
sudo ./srt_publisher.sh /home/ubuntu/test.mp4 srt://srt.antmedia.io:4200?streamid=LiveApp/test 10
```

This command will publish 10 SRT streams with stream IDs `test_1`, `test_2` etc. in the LiveApp application of your Ant Media Server.

Replace `file.mp4` with the actual mp4 file, the URL with the actual URL of your Ant Media Server and `10` with the number of SRT streams you want to simulate.

- Wait for the test to be completed.
- Use the following command to stop the HLS load test:

```bash
sudo pkill ffmpeg
```

Similarly, you can increase the SRT streams load count as needed.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ In this option, we have only one Ant Media Server instance as SUT.
| | rest | |
+-------------------+ +----------------------+
```
To setup the Ant Media Server, please check [here](https://antmedia.io/docs/guides/installing-on-linux/installing-ams-on-linux/).
To set up the Ant Media Server, please check [here](https://antmedia.io/docs/guides/installing-on-linux/installing-ams-on-linux/).

### Cluster setup

Expand Down Expand Up @@ -64,7 +64,7 @@ Here we have a cluster structure as SUT which contains one origin and N edge ser
+----------------+ +----------------+ +----------------+
```
To deploy an Ant Media Server cluster, please see [here](https://github.com/ant-media/Ant-Media-Server/wiki/Scaling-and-Load-Balancing).
To deploy an Ant Media Server cluster, please see [here](https://antmedia.io/docs/guides/clustering-and-scaling/scaling-ant-media-server/).

## Ant Media WebRTC test tool

Expand Down

0 comments on commit 556b416

Please sign in to comment.