AWS Fargate Pricing – Hosting Apps On Serverless Compute

AWS Fargate is a serverless computing offering of Amazon, and it is a pay-as-you-go model, hence understanding AWS Fargate pricing is important. With AWS Fargate you can run your applications without having to manage the servers.

With AWS Fargate you run containers in Amazon EKS or ECS.

AWS Fargate Billing is based on CPU or memory requirements per second, you only pay for what your task running/consumes.

It is important to understand how you can optimize the AWS Fargate usage to manage your AWS Fargate costs, if not done so Fargate is more expensive than AWS EC2 when running the same workloads for a month.

So, when you are not managing servers and not doing tasks such as resource allocation, building HA, patch management, and more, you can focus on accelerating the process of going from idea to production on the cloud.

This will also reduce the technical skills required and reduce your overall cost of ownership.

Factors To Consider While Working On AWS Fargate Cost

The question is, how does AWS Fargate pricing work?

Below few factors you need to remember for deciding on Fargate price

  • Virtual CPUs (vCPUs on Linux/x86) requirements
  • GBs of RAM for running services
  • On-demand instances
  • Spot instances
  • AWS Saving Plans

So, based on your application nature and demand you can select the appropriate option for your serverless computing need.

AWS Fargate Price Example

Here is a reference of AWS Fargate pricing (prices for the US East / North Virginia region):

1 vCPU costs $0. 04048 per hour or $29.2 per month

1 GB of RAM costs $0. 004445 per hour or $2.9 per month

1 GB of ephemeral storage (for ECS) costs $0.0001 per hour or $0.081 per month

This is available on the AWS pricing calculator and taken from the same.

Taking the above price at US East / North Virginia region, let’s work on the below example to understand the pricing

So, assume our application needs:

  • Fargate configuration with 4 vCPUs and 8GB of RAM
  • Adding 30 GB of ephemeral storage
  • Run this for a month (~730 hours)

The price calculation will look like below:

Fargate vCPU Cost: $0.04048 per vCPU/hour * 730 hours * 4 vCPUs = $118.202 per month

Memory Cost: $0.004445 per GB/hour *730 hours * $8GB = $25.959 per month

Storage Cost: $0.81 per month (first 20GB are free, $0.81 is for an additional 10 GB)

Total Cost: $144.97 (One month usage)

The above AWS Fargate Price is for one month of usage, apart from this you will have other components billed along with this based on the usage.

Amazon pricing can change, so for the latest prices in your region visit the official pricing page.

AWS Fargate Pricing Table

Architecture$ per vCPU per hour$ per GB per hour
Linux/x860.040480.004445
Linux/ARM0.032380.00356
Windows/x860.091480.01005

You get to use 20 GB of ephemeral storage included for all your Tasks and Pods. You be charged $0.000111 per GB per hour for additional storage used over the 20 GB limit.

AWS AWS Fargate and EC2 Price

Let’s look at AWS Fargate and EC2 with similar configurations, what does the price difference look like

We will again take the same example and remove the storage from it, so that we can compare the compute.

So, assume our application needs:

  • Fargate configuration with 4 vCPUs and 8GB of RAM
  • Run this for a month (~730 hours)

The equivalent in EC2 is a c5.xlarge instance with 4 vCPUs and 8 GB of RAM

The price calculation will look like below:

c5.xlarge EC2 instance with 4 vCPUs and 8 GB of RAM. Its hourly on-demand price is $0.17.

For one month = $124.1

A Fargate configuration with 4 vCPUs and 8GB of RAM is ~$0.19748 per hour.

For one month = $144.1604

So, you can see the Fargate charges a ~16% additional amount compared to c5.xlarge EC2 instances for this configuration.

So, now you have got this, when you consume Fargate service, you basically set the number of tasks you want to run multiplied by the amount of vCPU and GB required by each task.

How To Reduce AWS Fargate Costs

You can follow some of the best practices and control your Amazon Fargate pricing, do not forget to monitor your usage and resources to avoid unnecessary charges.

Calculate Your ROI In Advance

Do your homework before deciding whether to go for service architecture yes or no.

Get around the service offering and ensure that you are getting the greatest ROI on your Fargate implementation. This can be done with some assumptions on application need and usage.

Explore Options of AWS Savings Plans

AWS Savings Plan is a pricing option, that will help you to save up to a good amount of the cost. The savings plan can recommend resources based on your previous use. This will help you with what amount you can commit.

Delete Idle Pods/Resources

Find out the right number of active pods you need at any given time and delete additional pods when not required. This can help you avoid additional costs.

Tagging Resources

Tagging resources can give more granular control and visibility, and this is true for all other resources too. Tagging can help you quickly identify which pods are orphaned or not in use and you can delete them quickly.

FAQ:

What is the Amazon Fargate pricing?

You only pay for the resources that you use(vCUP, RAM and Storage), it is pay-as-you-go model. There are no upfront fees for Amazon Fargate.

Can I run Arm architecture applications on AWS Fargate?

Yes. AWS Fargate helps you to run your Arm-based apps, you need to use Arm-compatible container images from Amazon Elastic Container Registry.

Can I use an existing Microsoft Windows License with AWS Fargate?

No, Currently Fargate will provide you Windows OS licenses attached to your vCPU when you choose to run the Windows option (Service includes OS fee).

Is AWS Fargate expensive?

Compared to similar configuration EC2 instances the AWS Fargate will charge you a premium amount, as it is a managed service from AWS.

Video Credit Amazon Web Services

Conclusion:

Planning always helps, minimizing operational complexity at a premium pay can be good choice for your business needs. You can use the AWS Fargate cost explorer, do your homework and I am sure the above information will help.

If you have technical expertise having your own Kubernetes cluster can give you more technical capabilities and advantages over Fargate.   

But if you have a simple application and don’t want to manage OS and other resources AWS Fargate is a good choice. Let us know your thoughts on this in the comment section below.

Leave a Comment