How do I calculate the bandwidth consumption of a file stored in Amazon S3?

I am developing a file hosting service in ASP.Net where users will have a certain bandwidth and bandwidth according to the plan they purchased.

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

How can i do this?

+2


source to share


3 answers


You can write a routing interface for the url used. Then you can track the generated image and how large it is. Now that you have this information, you can simply track the number of requests and calculate the bandwidth. It will be a little slower to search the URL, but the image will only need to be loaded once to the browser.



+1


source


The best I can say is they don't offer that level of detail for reporting. The only way I can do this is to host a proxy that grabs files from S3, registers the bandwidth and returns it to the user. Unfortunately, you pay for bandwidth twice and then you just measure it. Maybe an alternative pricing model will work?



0


source


You can enable logging , capture log files and calculate statistics for each user.

0


source







All Articles