November 13, 2013

Load balancing and failover with Nimble Streamer

Nowadays HTTP based protocols become more and more popular for many reasons and about a half streaming media has switched to use them by now. This movement will proceed and this is why it was decided to implement Nimble Streamer, a light-weight media server for HTTP protocols re-streaming and VOD content processing. So it is intended to be used as a basis for content delivery over HTTP.

Building robust content delivery network means that the content must be delivered regardless of availability of all servers. Let's see how Nimble Streamer can be used for these conditions.



UPDATE
WMSPanel team released an article describing the recommended approach to load balancing for HTTP-based protocols like HLS, DASH, Icecast etc. Please use the technique described there to build your own balancing solution rather than HTTP redirect-based approach shown below. The text below is considered obsolete.



A typical CDN consists of two major parts - content origins and delivery edge servers. Origins are typically stores the content, makes transcoding, re-packaging and transmuxing. Origins are heart of any CDN and we recommend using Wowza Media Server as an origin especially in case of live video.

Edges are required to:
  • off-load the origins, e.g. they might be too busy with encoding,
  • pass around transmission bandwidth limitations as any server has its throughput limitations,
  • improve robustness in case of server failures.
Having several edges, we cannot point a player to some certain server. We should use domain name in this case and once any of the edges goes down, we need to make sure that all new connections will go to properly functioning servers. DNS failover (DNS round-robin) technique can be used for having some single domain name as well as providing a robust failover since DNS allows mapping several IP addresses to one domain.

Origin and Nimble Streamer edges with DNS failover.

Let's see a possible network architecture to cover live streaming use case.

1. Origin


We have an origin server that provides a stream which is packaged with HTTP Live Streaming (HLS, or Cupertino), Microsoft SmoothStreaming (Smooth) or progressive download. It may use any streaming media software like Wowza Media Server, Nimble Streamer, nginx, Microsoft IIS etc.

2. Edges


We will take Nimble Streamer as edge software. Nimble will take requests for contents from the player and will request that contents from origin. As soon as the chunk is started to be downloaded, it's being given to the player and then stored in cache - either RAM cache for live streaming or ROM for VOD streaming. Once a content chunk is available in cache, it will not be requested from the origin.

Re-streaming routes are easily set up in WMSPanel. The most convenient feature for this case is that you may describe a route and apply it to multiple servers. So it doesn't matter how many edges you have, you may be sure that all edges will have identical routing settings.

3. DNS


Now let's make sure our content from the origin will always be available for any player via single robust access point.

DNS failover is based on using multiple A-type DNS records for the same domain name which point to a set of IP addresses. We use DNS failover for providing robust balancing for our WMSPanel cloud service. The records would look like this:
video.ultimatemediastreaming.com A 162.243.88.159
video.ultimatemediastreaming.com A 162.243.88.131
It's all set.

4. Streaming


Now you may use URLs like this for using in a web or desktop player:
http://video.ultimatemediastreaming.com:8081/live/playlist.m3u8
You can be sure that any new connection will be taken care of using either of those 2 mentioned edges. If one of them goes down, the second one will keep processing incoming connections and give the content back.

Now you can try it yourself. Just follow installation instructions and contact us if you need help.

Check how to build robust streaming infrastructure with DigitalOcean and Nimble Streamer.


You can also read "The Paranoid’s Guide to Internet Video Streaming" by Thomas Gires to see real-life example of using pay-per-view feature set along with Nimble Streamer as light-weight edge for HLS re-streaming.

Related documentation


Nimble HTTP StreamerMP4 transmuxing to HLS VOD streamingStreaming VOD with DigitalOcean and Nimble StreamingNimble configs explainedHLS re-streaming set upSmooth Streaming supportNimble Streamer HTTP hotlinking protectionRAM caching for effective re-streamingWMSPanel Slideshare, Geo-location load balancing with Nimble

No comments:

Post a Comment