Search code examples
amazon-web-servicesamazon-s3amazon-cloudfront

How s3 or cloudfront calculate my bandwidth consumption?


I am really confused about how to calculate my user bandwidth consumption

for example, let say I am serving a video file from s3 using CloudFront CDN

100 MB video file * 10 people watched it => 1000 MB bandwidth // Simple Right

but my question is

what if some user didn't watch the video 100% in this case 10 people watched my video only 50%

100 MB video file * 10 people watched only 50% => 500MB bandwidth Right ?

But is this the way S3/Cloudfront calculate bandwidth usage or it is based on

URL request * 100 MB


Solution

  • The S3/CloudFront transfer cost is based on the total amount of data transferred out of S3.

    The correct way to think of it is how much data the users downloaded. If they watched 50%, they still may have downloaded 100% if their browser was buffering ahead.

    So, if each user downloads 50%, then yes, you pay for 500 MB of bandwidth, but if each user watches 1/2 of the video, but their browsers all buffer 100 MB of data transfer in that time, then you still pay for 1000 MB of data transfer.