Question

I have an app that calls my ASP.NET page on my server, every 30 seconds. I want to use this for two purposes:

  1. Graph the uptime of my client
  2. Graph the average bandwidth from my client to the server

What is the best way to calculate the bandwidth (in bytes per second) from the client to the server?

I assume that I record the time, call the page, wait for a response, then get the time again, compare the times and calculate the bandwidth... but how to calculate the bandwidth?

Was it helpful?

Solution

If you are trying to figure out how much bandwidth your proposed 30-second plan is consuming, a rough guesstimate is page size * number of executions in a minute (in your case, 2) divided by 60 (number of seconds in a minute), times 8 (number of bits in a byte) for bits per second. Does not include overhead.

If you want to know what your server load is, there are better tools for that, and you can roll your own if you wish. See http://www.codeproject.com/KB/aspnet/JavascriptBandwidthMeter.aspx

OTHER TIPS

Calculate it this way: size of file (in KB) / elapsed time (in sec). That gives you KB per second (KB/s). It's a bit different than kbps, but I think it's more useful to the average user. Be sure to use a large enough file. Something large enough where you're pretty sure the elapsed time will be at least a few (3-5 maybe) seconds.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top