Blog

How to monitor Amazon CloudFront usage with Average Object Size (AOS)

amazon-cloudfront

We share expert insights on how to keep track of Amazon CloudFront's usage with AOS

As the Amazon CloudFront pricing page reveals, customers who commit to more than 10Tb/month can reach out to the Amazon Web Services (AWS) sales team and ask for a private pricing proposal. 

The rationale behind this offer is clear: If you commit to consuming a certain amount of traffic over time, AWS will give you a discount on CloudFront.

As part of my job at DoiT International (AWS Premier Partner), I help customers to optimize their content delivery network (CDN) usage and monitoring. And sometimes AWS will ask the customer to meet a certain level of Average Object Size (AOS). In this article, I explain how AOS works and how it can be monitored.

How the AOS works

The AOS is the average object size across all your CloudFront distributions in AWS Organizations. It is calculated in kilobytes in a relatively simple manner: The number of requests (HEAD/GET HTTP/S requests) you delivered through CloudFront is divided by the amount of data you transmitted through CloudFront.

For example, if I use CloudFront to deliver 1,000 requests that consume 1Gb of data transfer, the calculation is:

1048576 Kb (1Gb in kilobytes)/1000 requests = 1048Kb AOS

Review your agreement with AWS to understand what it means to deviate from AOS

If a customer's AOS consumption in a given month is lower than the number in the agreement with AWS, the customer will be charged for HEAD/GET requests according to the terms agreed in the customer Private Pricing agreement.

If the AOS in the account is lower than the number specified in the contract, the customer will see a charge for OCBCloudfront (Out of Cycle Bill CloudFront) invoices the following month.

How to monitor the AOS 

Many CFOs and DevOps and FinOps engineers are frustrated by the lack of tools to monitor the AOS. At DoiT International, we provide our customers with advanced cloud analytics technology to sample, monitor and alert when they are below a certain AOS. The customer has real-time access to the cost of requests if they have deviated from the AOS in a particular month.

aws-monitoring

(DoiT cloud analytics graph displays CloudFront AOS in Kb)

monitor-aws-costs

(DoiT cloud analytics graph displays CloudFront AOS in Kb)

We receive many inquiries from CFOs and DevOps and FinOps engineers who are not DoiT customers (and also from competitors) who want to know if we can help them with AOS monitoring.

DoiT's business model is simple: The customer gets all our services for free if he consolidates the company's AWS accounts with us. But in certain situations, the customer can’t consolidate to DoiT. 

For these scenarios, I have created a solution for calculating  the AOS, using the AWS Cost Explorer API.

I wrote a python script that leverages the Cost Explorer API and returns the AOS for a specific month. You can specify the --month and --year arguments to extract the AOS for historical dates. If you have multiple aws organizations (or aws accounts) you can use the --aws-profile argument.

aws-application-performance-monitoring

The profiles will be pulled from your ~/.aws/credentials file (or C:\Users\USERNAME\.aws\credentials on Windows.); the default aws profile is the default profile.

This provides a useful workaround for AWS customers who cannot consolidate to DoiT. As an AWS Premier Partner, we work with AWS to help customers leverage the cloud for the enhanced performance, scalability and agility it enables for ambitious companies seeking a competitive edge. 

Subscribe to updates, news and more.

Leave a Reply

Your email address will not be published. Required fields are marked *

Related blogs

Connect With Us