[object Object]

Hosting ASP.NET apps on AWS Appendix B - AWS pricing

How-to written and screenshots taken on 2020 January 31

Aaah, Amazon pricing, what a joy. Although the basics are pretty self explanatory, it gets complicated really quickly. How do I determine how many GET requests my bucket will get? Or how many DNS-queries are realistically to be expected? How many emails are you going to send?

Because AWS pricing is (mostly) done on a per-use basis, for everything, it can get complicated pretty quickly. You pay tiny amounts for a lot of things. To make it even more complicated you can also use savings plans or save money by making service reservations.

Ow, and AWS has a free tier. That means that you can use some service for free for the first 12 months, but not all. Some services actually have a certain free limit indefinitely.

Calculators

AWS knows their pricing model is complex, so they build the "Simple" Monthly Calculator. Which is also complex... damn. But they know that too, so they build the Pricing Calculator. Which in Quick estimate mode is quick good. So we'll use that one to calculate the costs for our setup.

Pay-as-you-go

AWS has a pay-as-you-go pricing model. Meaning you pay for the resources you use per second/minute/hour or per request/query/action. When you know what you need, you can save money by reserving capacity.

https://aws.amazon.com/pricing/

Examples

EC2

Simple pricing calculator?

The thing I wanted to know, but took me a long time to find: what does Amazon mean with "Usage". Do you use you EC2 when it's running, but CPU idle? Do you pay 20% if your average CPU usage is 20%? Or are you using it when it is stopped or are you only not using it when it's terminated?

Pricing is per instance-hour consumed for each instance, from the time an instance is launched until it is terminated or stopped. Each partial instance-hour consumed will be billed per-second for Linux Instances and as a full hour for all other instance types.

https://aws.amazon.com/ec2/pricing/on-demand/

After a few months of using it and with this quote, I now know it has nothing to do with CPU utilization. If you run your instance 24/7 every day of the month, that's 100% utilization. If you stop your instance, those hours don't count. You do however pay for the EBS volumes. So only when you terminate an instance and delete the associated volumes, you stop paying.

Example

Let's look at our 2 instances. We have a Linux t3.micro with 8 GB EBS and a Windows t3.small with 50 + 4 GB EBS. I have bought standard reserved instances for a year for both.

CalculationAmount/monthAmount upfront
Simple Monthly Calculator$ 23.18$ 189
Pricing Calculator$ 23.07$ 189
Bill February 2020$ 25.28$ 189

Current Bill

In total we currently spent roughly $45 per month. That is including CloudWatch, Data Transfer, Route 53, S3


RDS

We don't use RDS for our database yet and for "good" reason. It's quite expensive for a small database. However, we do want to start using it when we are able to migrate our MSSQL database to MySQL. More on that in appendix E.

Example

Let's see what an MSSQL, MySQL and Aurora (AWS MySQL) database instance costs. We'll take a t3.small instance (smallest MSSQL and Aurora) and compare the on-demand pricing with a standard 1 year reservation.

EnginePricingAmount/monthAmount upfront
MSSQLOn-demand$ 39.34$ 0
MSSQLReserved$ 13.69$ 131
MySQLOn-demand$ 31.94$ 0
MySQLReserved$ 12.67$ 119
AuroraOn-demand$ 37.42$ 0
MySQLReserved$ 13.33$ 135

ELB

We want to use load balancer in our improved architecture. The numbers it needs for the calculation are totally unknown though.

https://calculator.aws/#/estimate?id=0499ef3ad1b5faec26169d6963777bfdbe56b5b1


Cost optimization

If you want to know how much you can save when using reserved EC2 instances, check out these pages: