Results 1 to 8 of 8

Thread: Limit download bandwidth

  1. #1
    Join Date
    Oct 2011
    Posts
    12

    Default Limit download bandwidth

    Hello - I am running ver 3 of the developer license on a AWS. I really like the quality of the live stream from an rtsp cam. I've done some searching and I see where there is an mod for limiting the number of connection and the bandwidth size. I am not sure that is what I am looking for.

    I am hoping to limit the total bandwidth that an application can stream over a given time period, say 1 month. I am trying to avoid a surprise 5k bill at Amazon by limiting how much bandwidth a stream can consume over a given period of time.

    Is this possible?

    Thank you - Scott

  2. #2
    Join Date
    Sep 2011
    Posts
    1,931

    Default

    Hi
    There are a few ways of doing this I have some tutorial links here,
    http://www.wowza.com/forums/content....treamBandwidth
    http://www.wowza.com/forums/content....an-application

    Jason

  3. #3
    Join Date
    Oct 2011
    Posts
    12

    Default

    Hi Jason - thanks for the response. I am not quite sure this will work for what I am looking to do. If I understand correctly, the bandwidth limiter module will only control the amounts of data that is being streamed at any particular moment time (not cumulative). What I am looking for is a way to put a cap on a streams bandwidth for the month. For example, I would like to limit a live stream to 10 connection at any given time and a total of 40GB of bandwidth used over the course of 30 days.

    If I used the bandwidth module and set it to 5000 kbit/s (assuming 10 connection feeds at 500 kbit/s) that will still equal 1544 GB of bandwidth a month (if streamed 24 hours a day). I am having a hard time figuring out how I would configure it so that the connection would not work if the 40GB is exceeded in a month.

    Are you currently using this module to limit monthly bandwidth? If so, do you mind letting me know how you are doing it? Sorry, having a hard time wrapping my brain around it.

    Thanks,

    Scott

  4. #4
    Join Date
    Sep 2011
    Posts
    1,931

    Default

    Hi
    Well If that's what you need then your best bet is to ask for a custom module to be made for you.
    You can do this by sending the requirements above to Support@wowza.com and a link to this thread for reference.
    You will be sent a list of independent consultants that could do this for you and looking at the figures above I think it will be money well spend as it could cost you a fortune if you went over as much as you mentioned above in bandwidth costs.

    Jason

  5. #5
    Join Date
    Oct 2011
    Posts
    12

    Default

    Hi Jason - excellent advise, thank you very much for your time!

  6. #6

    Default

    Scott,

    It's hard to add up the values in the Wowza logs. Also, you're concerned with total bandwidth, which may include your web server, so I would do the calculation on the system level. In debian:

    ifconfig eth0 | awk -F: '/TX bytes/ && $NF > 40*1024*1024*1024 { system("service WowzaMediaServer stop");}'

  7. #7
    Join Date
    Oct 2011
    Posts
    12

    Default

    Hi Randall - thanks for your help on this. I think this is a great idea to get me started. I started Wowza and ran the command you gave me above. It immediately shut down Wowza. I am using the AWS Linux AMI. Would you happen to know what tweets would need to be done to that command for the aws Linux? Thanks again for your help.

  8. #8

    Default

    The little script compares the cumulative value in bytes that is just after "TX Bytes:" in your ifconfig command, to "40*1024*1024*1024" which is 40GB. The cumulative bytes resets after a network restart. If you haven't restarted in a while, the value is probably over 40GB, which is why the Wowza service is immediately stopped.

    You'll have to modify the script to account for the possibility that your server restarts mid-month, by implementing a stack to record the new TX value each time the network restarts. Put that in a cronjob that runs every minute or so. Make another cron job that runs once a month which restarts the network and zeros the stack/file. Here's some psuedocode:

    if tx < sum(stack)
        pop(top)
        if tx < top
            push(top)
            push(tx)
        else push (tx)
    else stack = tx

Similar Threads

  1. Limit publish bandwidth - once again
    By eluis2011 in forum Live Streaming and Encoder Discussion
    Replies: 7
    Last Post: 10-04-2013, 06:57 AM
  2. Limit Bandwidth
    By kleberrvf in forum General Forum
    Replies: 1
    Last Post: 02-29-2012, 12:34 PM

Posting Permissions

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