Sunday, April 12, 2020

Load balance multiple incoming RTMP streams

Just wondering if anyone has had any experience with or can throw out some advice on how to load balance multiple incoming RTMP streams. I realise that there are TONS of articles etc about load balancing outgoing streams to viewers, but we're a media company who ingests streams at scale so we're on the other end of the spectrum.

At the moment, we pre-provision a dedicated "slot" on a server instance running Wowza Streaming Engine for each client source that we sign up (up to a maximum of 5 per server) - obviously this is not:

  1. Scalable or
  2. Sustainable or
  3. Affordable

We're going through a phase of really rapid growth at the moment, and I would much rather find a way to have a standing pool of available servers which I can dynamically allocate individually per incoming stream as required - that way we're only really worried about "how many streams we're ingesting concurrently" rather than "how many servers do I need to have running in case X clients send us a stream". Basically it will mean instead of having 25 servers running 24/7 to ingest 125 potential streams, we can run, say, 15 or 20 smaller servers to handle one connection each, but concurrently - ideally even only spin up the required number of servers for a known number of concurrent scheduled streams (if we know we're only going to be doing 10 concurrent ingests, then we only need 10 instance running).

Happy to give more detail where necessary - I've looked into some potential solutions such as DSR, OpenResty and HAProxy, but I think I really need to just start with some basic networking advice.



No comments:

Post a Comment