Live Streaming on a Budget (Part eleventy point one) – Metrics Revisited

Back in July, I made a post about metrics and a cheesy VB Script that got the job done, but wasn’t particularly elegant. I’ve since improved on this due to load balancing (I posted about that in September).

I’ve since then learned a bunch about RRDTool, and have put together a script that pulls the XML data, groks it, and then populates an RRD. The net result is that I get a graph like this:

streams-200911151215

This graph gives me the following information: The iPhone stream count (with a 10:1 vertical exaggeration), the Flash stream count, and the total viewer count, which is the sum of Flash and iPhone streams, multiplied by a factor of 1.7 (which we’ve found reasonably reflects how many actual people are watching, versus streams. Then the vertical red line shows the time the peak occurred, and the horizontal line shows the level of that peak. The actual peak numbers are listed on the bottom. The RRD and the graph are set up to take into account Windows streams, just as soon as I find a good way to pull that data from WMI via perl.

The general operation is as follows: There’s a script that’s started in a cron job 10 minutes after the servers are spun up, and it polls the origin server every 10 seconds for its counts and populates the RRD. There’s another cron job that runs every minute to generate a current graph, which is then displayed on a page with some javascript that refreshes the image in realtime. Then, at 12:15 and 6:30, there’s another cron job that takes a snapshot of the previous two hours, puts it into a web-accessible directory, and appends an HTML file with a link for easy access later.

All of the metrics scripts, automation scripts, and graphing tools live on a linux virtual machine that runs on our central campus.

This is big improvement over dumping a vbscript into a CSV and then graphing manually with Excel. This happens automatically, in real time, without me being there.

3 Comments On “Live Streaming on a Budget (Part eleventy point one) – Metrics Revisited”

  1. Nice graph! I found your page today and appreciate your posts. I’ve been going through some of the same things and came up with a similar but lighter weight solution which I have documented here: http://headbackup.com/index.php/Wowza_Media_Server#Graph_Wowza_Connection_Statistics

    The method I’m using is not written to handle multiple instances but could be modified to do it probably. I’d say it’s somewhere between your VBS scripts and your new method, but it doesn’t require rrdtool. Just thought I’d post a link in case it might be helpful to someone.

    Andrew

    Reply

  2. Sorry, I was doing some site maintenance last night so it was down for a couple of minutes but should work now.

    Andrew

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *