arut / nginx-rtmp-module

NGINX-based Media Streaming Server
http://nginx-rtmp.blogspot.com
BSD 2-Clause "Simplified" License
13.45k stars 3.51k forks source link

How to Edge node pull from multi Master nodes #768

Open kohaku1907 opened 8 years ago

kohaku1907 commented 8 years ago

I have one master ingest server and multiple edge nodes that each pull from the ingest server. But now i have 10000 cameras (1920x1080) push streams to master ingest server , i m afraid it can't handle it. So i plan to add more master ingest server ( with LoadBalancer LVS to handle which master ingest server those cameras will push stream to). But with more than one master ingest server how edge nodes pull all those stream . I also test pull option in edge node like this

application live { notify_method get; idle_streams off; pull rtmp://master_server_1/live live=1; pull rtmp://master_server_2/live live=1; }

But it only pull stream from master_server_1. Any advice ? Thanks

Btw, I think i dont need more master server , just upgrade bandwidth . Is it right ? Thanks. I see this http://nginx-rtmp.blogspot.com/2013/05/simple-pullpush-dns-load-balancing-in.html . Could it solve my prolem?

sergey-dryabzhinsky commented 8 years ago

The fastest (in development) solution I think is: create "groups" of ingest and multi-edge nodes. In which group push or pull - will decide some backend (your site) by it's load and capacity. Split all 10k cameras by that groups of servers.

The second one - make nginx-rtmp to notify on play to backend which is decide which edge node should response to stream. And nginx-rtmp must send (is needed) "redirect" status to player which must understand it.

misiek08 commented 8 years ago

Load balancer on every edge node, run few nginx instances and load balance request to correct nginx instance. There is nothing built-in, so you need to direct connections to port or have own smart load balancer.