A
A
Alexander Shirobokov2014-11-19 11:12:54
Nginx
Alexander Shirobokov, 2014-11-19 11:12:54

How to set up NGINX_RTMP balancing?

There was a question how to make balancing. After reading the wiki of the module, I realized that the balancing issue is solved through pull and push directives.
Situation (example):
There are two nginx-rtmp servers A (master) and B designed for 10 connections each and STREAM stream.
Let's say that server A already has 9 connections (not taking into account the connection of the STREAM itself).
Question:
Is it possible to make it so that on the tenth connection to A, A creates a push to B (or otherwise) and transfers the tenth and subsequent connections to B?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
D
Dan Ivanov, 2014-11-19
@ptchol

There is no balancing within the module itself.
In your case, it seems to me that it is worth putting some kind of haproxy in front of nginx and they will resolve your wishes.
Perhaps the following solution will work: catch the on_play event and make a call to some script, to which, for example, pass the broadcast ID as an argument, this script checks if there are too many already connected clients, and if they exceed some value, then redirect is called using control module .
But IMHO it's a bit too crutch :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question