Larry Ludden - Enterprise Java Developer - AWS Cloud Architect

Back to home

Comparison of AWS Container Options and Cost

( This is the Gemini NotebookLM Podcast of the article if that's more convenient )

As I was getting ready to deploy a small POC application that I had written ( a type of name-that-tune application ) I realized that, even though I had used most of the different services for deploying applications and had a rough idea of the cost, I had never directly compared them.

Most likely, this was because it's difficult to do without knowing many other factors: How many requests or instances will you need? How long do requests take? How resilient does the application need to be? (for example, if it's in development, preproduction, or is just a proof of concept). So I picked a specific set of requirements and built out a cost chart—primarily because I wanted to see how much it costs to have things managed by AWS. While there are certainly situations where that is worth the cost, there may be other times when it isn’t. This is my attempt at exploring that.

High-level requirements

  • Need to host a public application that only needs a single instance of compute.
  • Application can potentially settle for 99.9% or 99.95% uptime
  • Application is not very CPU intensive
  • Assuming a containerized image/application
  • Includes a public endpoint and HTTPS certificate provided by CloudFront ( saves on public IP address costs )

High-level caveats

  • Starting with 1GB of memory and the minimum available vCPUs
  • Bandwidth and disk space is not included (assumed to be approximately the same for all solutions)
  • Load Balancer ( LBaaS ) costs do not include additional LCU charges for usage
  • Costs were pulled from the us-east-1 region

AWS Container Cost Comparisons

But a comparison like this needs lots of fine print—hopefully, I’ve thought of most of the important considerations:

AWS App Runner

The service charges based on any requests that occur during a given minute. So even a single request in a minute will be billed as 100% usage for that minute. However, if requests are only made during business hours (e.g., 40 hours per week), you’d be billed for roughly 25% usage. This service supports auto-scaling if needed.

ECS

While it’s possible to use ECS without a Load Balancer, it requires quite a bit of manipulation. So these costs assume that a Load Balancer is placed in front of the ECS cluster/container. The cost is calculated using an internal load balancer and CloudFront to provide public access. This service supports auto-scaling if needed.

Docker - EC2 On-demand

This setup involves a single EC2 instance running Docker and the application (which would need to be scripted). CloudFront would be used to route traffic to the instance.

Docker - EC2 Spot

This involves a single Spot instance created in either Stop or Hibernate mode, so that the same instance will be restarted when capacity becomes available—though for this instance type, capacity is almost always available. The instance runs Docker and the application (which would need to be scripted). CloudFront would route traffic to the instance.

Lambda

The cost listed for Lambda assumes one request running continuously for the entire month—but that’s only for a single request. Comparing Lambda to instance-based solutions is difficult without knowing traffic volume and duration per request.

Conclusion

For a simple, single instance workload that doesn't need to be auto-scaled, you can save quite a bit of money by using a less managed solution. Clearly for most professional or production related workloads letting AWS manage more of the infrastructure and having auto-scaling available will be worth the additional cost. But for smaller POC or Dev type of applications, being able to have them run in AWS for less than $2 a month is a good tool to have in your toolbox. 

 

Articles