Results 1 to 4 of 4

Thread: Find Least Loaded Server Using jQuery

  1. #1

    Question Find Least Loaded Server Using jQuery

    I have load balancing set up -- an ORIGIN server and an EDGE server.

    I have my Flash modules pointing to the ORIGIN "redirect" with a stream name of "" and the .stream file has the following:

    In this case, "" would be the ORIGIN, and would be the EDGE.

    This setup works great for Flash modules that I create, but I would like to perform loadbalancing with iOS devices. I have no problem getting the least loaded server using jquery:

    <!DOCTYPE html>
    <html lang="en">
      <meta charset="utf-8">
      <title>Get Least Loaded Server IP Address</title>
    <script src="jquery-1.8.2.min.js"></script>
        $.get('', function(redirect) {
    	var edgeIP=redirect.split('=')[1];
    The problem I'm having, is once I point an iOS device to this least loaded server -- what application and streamname do I send it to?

    When using my Flash modules I can go to the following EDGE address and see that I have streams playing through the "liveedge" application:
    Of course, the streamname for the Flash module is "" and everything magically happens.

    Is there a way to point an iOS device (or Roku, or whatever) to an EDGE server (either using the jQuery method above, or even by hard-coding the EDGE address)?

    I originally tried hard-code-pointing the iOS page to the following stream:
    But there is nothing there. I've tried a lot of different app names and stream names -- nothing seems to work for me. I just can't figure out what how wowza handles this with Flash (why can "liveedge" pull a live stream from the ORIGIN and play it back for a Flash module, but seems to be dead for anything else?). I even tried putting the full URL of the ORIGIN stream ( into a .smil file on the EDGE thinking that maybe it would work similar to a .stream file... but again, nothing.

    Any thoughts on if this is possible? Can you point an iOS device directly to an EDGE server... and have that EDGE re-broadcast a live rtmp stream from the ORIGIN server?
    Last edited by davidlgood; 11-16-2012 at 09:57 AM. Reason: Clarification

  2. #2
    Join Date
    Dec 2007


    Only use the "redirect" application for getting least loaded server, not streaming. Don't publish a live stream to it. Make sure you keep load balancing and streaming separate, they have nothing directly to do with each other.

    You publish a stream to a live origin application with a RTMP encoder, or start a MediaCaster stream, or start a Stream class stream. You re-stream from an edge. Follow this tutorial to set up one origin and one edge and test that all out:

    Following that guide, with a stream named "" and edge app named "liveedge", and with the least loaded server in-hand from your jQuery, the url is:


  3. #3



    Thanks, once again, for the help. Don't worry -- I wasn't publishing a live stream to "redirect" -- everything was set up properly (I was just pointing my Flash module to redirect to get the least loaded server, as you've described).

    Your example code did the trick! It turned out to be an error in the way I was structuring the naming the URL.

    As always -- thanks a million.

  4. #4
    Join Date
    Dec 2007


    Great, glad it's working. Thanks for update,


Similar Threads

  1. Get Least Loaded Server
    By mmiller8 in forum Video On Demand Streaming Discussion
    Replies: 2
    Last Post: 03-12-2014, 11:54 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts