pokeb/asi-http-request — Issue #305: Bandwidth monitoring and throttling way off?
Author: alleus
Created: 2012-02-01 21:56:04+00:00
State: open

I'm having some major issues with the readouts from the bandwidth monitor and throttling when uploading files with ASIHTTPRequest. I know it's a rough estimate, but for me on OS X it's kinda way off track.

Using the sample application modified to POST a 1 GB file to my own server, I'm getting the following results. I'm measuring quick and dirty with Activity Monitor and iStatPro:

Without throttle, ASIHTTPRequest reports about 4 MB/s

![ASIHTTPRequest - Without throttle](http://dump.1g.se/upload/XIwu.png)

Both Activity Monitor measures an average a bit under 1.5 MB/s

![Activity Monitor - Without throttle](http://dump.1g.se/upload/el2y.png)
![iStatPro - Without throttle](http://dump.1g.se/upload/tzLa.png)

The same is observed when throttling the bandwidth. In the following scenario, I've set the `maxBandwidthPerSecond` to `1048576`:

With throttle, ASIHTTPRequest reports about 1.2 MB/s (close enough to the wanted 1 MB/s)

![ASIHTTPRequest - With throttle](http://dump.1g.se/upload/Dkrc.png)

But when measuring the actual throughput, it's more like 0.5 MB/s

![Activity Monitor - With throttle](http://dump.1g.se/upload/5zGR.png)
![iStatPro - With throttle](http://dump.1g.se/upload/N5Hg.png)