views:

222

answers:

3

I'm developing a file hosting service in ASP.Net where the users will have a certain amount of storage and transfer bandwidth according to the plan they purchased.

Considering the fact that I will be using Amazon S3 to store the files, I'm looking for a way to track the amount of bandwitdth used by each file, so that I can associate this consumption with a certain user and notify him when he reaches the limit for his account.

How can I do that?

A: 

Best I can tell, they don't offer that level of granularity for reporting. The only way I can think of to do it would be to host a proxy that grabs the files from S3, logs the bandwidth then returns it to the user. The unfortunate part of that is that you are paying for the bandwidth twice then just to meter it. Maybe an alternate pricing model would work?

John Sheehan
What kind of alternate pricing model would you think of?
holiveira
+1  A: 

You could write a routing frontend for the URL's being used. You can then track the image being created and how big it is. Now that you have that information you can just track the number of requests and calculate the bandwidth. It will be a tad slower to do the URL look-up, but the image will only have to be downloaded once to the browser.

rick schott
A: 

You could enable logging, grab the log files and calculate each user's statistics.

Fozi