I have just finished setting up Application Load Balancer on AWS. I am trying to figure why my Processed Bytes metric is giving such a high number (and as a result Consumed Capacity Units go up and it becomes expensive). How is this actually calculated? I have tried to browse the internet for this answer but there's no details on it.

Is it only header / response size or actually all data that goes from the webworkers? May be a dump question but if we load any 3rd party css or js, is it also included in these calculations or we're happy it's all loaded on the user side and LB doesn't have to do anything about it?




Every byte that goes through the ALB is billed. Pricing is here. The AWS pricing page gives an example how to calculate pricing. Basically every connection, byte, and rule adds to the cost.

If you load resources from another server / domain that's not behind the ALB then that's not billed as it never touches the ALB - the client connects directly to the server hosting that resource. Setting up your caching headers properly and using a good CDN such as CloudFront (billed per MB) or CloudFlare (they have a free option) could reduce your costs for js, css, images, and other static resources. CloudFront and probably CloudFlare can cache dynamic pages if they're not customised per user, but the setup is a little more involved.

Here's the current info around LCU's from the Amazon page. You'll note it doesn't ditinguish between http parts of the message, it's "bytes processed"

An LCU measures the dimensions on which the Application Load Balancer processes your traffic (averaged over an hour). The four dimensions measured are:

New connections: Number of newly established connections per second. Typically, many requests are sent per connection. Active connections: Number of active connections per minute. Processed bytes: The number of bytes processed by the load balancer in Gigabytes (GB) for HTTP(S) requests and responses. Rule evaluations: It is the product of number of rules processed by your load balancer and the request rate. The first 10 processed rules are free (Rule evaluations = Request rate * (Number of rules processed - 10 free rules) You are charged only on the dimension with the highest usage. An LCU contains:

  • 25 new connections per second.
  • 3,000 active connections per minute.
  • 1 GB per hour for EC2 instances, containers and IP addresses as targets and 0.4 GB per hour for Lambda functions as targets
  • 1,000 rule evaluations per second.
  • Thank you @Tim it answers my question, makes sense! We already use Cloudflare for basic static content caching. Thank you for the suggestion about dynamic pages caching, I will look into it a bit further. There's no user-based customisations so it may potentially work here. – Mateusz Drankowski Aug 1 '19 at 0:14
  • Also interestingly while looking at the traffic patterns I figured there's a lot of it coming from China (which is certainly not a target market for our website). It may be another way to find some savings around LB :-) – Mateusz Drankowski Aug 1 '19 at 0:15
  • With CloudFlare you can block countries, reducing ALB traffic. Make sure you have a security group only accepting connections from CloudFlare IPs and your own office / home IP ranges. – Tim Aug 1 '19 at 0:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.