Cost Estimates for Hosting Small, Medium and Large Websites with AWS

Cost Estimates for Hosting Small, Medium and Large Websites with AWS

Photo by Steve Johnson on Unsplash

In previous posts, I provided an overview of what the AWS Free Usage Tier contains and some basic guidelines for avoiding overage charges while using the free tier to host a small website.

In this post, I will explore the different pricing models that Amazon offers for EC2 and RDS instances and estimate the cost to host four different website configurations for one year. I decided to gather this data in order to answer the following questions:

  • What amount should I expect to pay to host my website with the same AWS instances when I'm no longer eligible for the free usage tier?
  • Given the light specs of the t2.micro instance (1CPU/1GiB RAM), what would it cost to host a site that requires more capacity? Or a large web application that handles thousands of simultaneous connections?
  • How much more would it cost to host any of these websites with a Windows/MSSQL toolchain versus the Linux/MySQL I'm currently using?
  • How much cheaper is the Reserved Instance Rate (pay for one year of usage upfront) rather than the On-Demand Instance rate?
Thankfully, Amazon created a tool we can use to answer these questions: the AWS Simple Monthly Calculator. Calling it "simple" must be an attempt at modesty because the calculator contains a massive amount of configuration options.

To begin, let’s take a look at the pricing models for EC2 and RDS instances.

EC2 and RDS Pricing Models

Amazon has four different pricing models for EC2 and RDS instances:

  • On-Demand rates offer the most flexibility since you can ramp up, scale down and re-locate your resources if your estimates and actual usage differ significantly. However, you’ll pay for the convenience. This is the pricing model used when you exceed your monthly limit of EC2 usage included with the free tier.
  • Reserved Instance rates require you to sign a one or three year contract for usage of a single instance type. This means that you cannot change to a more powerful instance type if you underestimated the amount of compute power or memory necessary for your website, or vice-versa (you cannot change to a less expensive instance type). You can pay for the entire year, pay for a partial amount or pay nothing upfront. Naturally, paying the full amount gives the largest discount, but signing a contract and paying nothing upfront is still cheaper than the On-Demand rate for the same instance type.
  • Spot Instances offer much cheaper rates than On-Demand instances, but they are not applicable to our scenario of a public-facing website which requires constant availability. If you need to train your new machine learning algorithm on a massive data set or you need to render a large 3d graphics project, spot instances allow you to access enormous CPU and GPU resources for a huge discount compared to On-Demand rates.
  • Dedicated Hosts/Instances will not be discussed further since their benefits are unnecessary for most websites, especially a personal blog site.

Along with the pricing model and the OS/database system you utilize, the cost of an EC2 instance varies based on the region of the world where the instance is located. All of the cost estimates I gathered are for the US East region.

Defining Our Data Set

My goal is to understand how the cost of hosting a website with AWS changes based on three different criteria:

  1. OS and database type
  2. Pricing model
  3. Size/capacity of the website

To do so, I decided to calculate estimated costs for four OS/database variations and 3 pricing models:

OS/Database Combinations Pricing Models
Linux/MySQL On-Demand
Windows/MySQL 1 Year Reserved Instance (Partial Payment Upfront)
Windows/MS SQL Bring Your Own License (BYOL) 1 Year Reserved Instance (Full Payment Upfront)
Windows/MS SQL Standard Edition (SE)  

In order to show how the cost savings change as the website size/capacity is increased, I created four different configurations of EC2/RDS instances, SSD storage, monthly data transfer amounts, etc. I’ve summarized the different website configurations in Table 1:

Table 1
Configuration Details for Example Websites
 Linux/MySQLWindows/MySQLWindows/MS SQL BYOLWindows/MS SQL SE
Free Usage Website
  • (1) Linux EC2 t2.micro instance
  • (1) 10GB SSD EBS volume
  • (1) 20GB RDS db.t2.micro MySQL instance
  • (1) Windows EC2 t2.micro instance
  • (1) 10GB SSD EBS volume
  • (1) 20GB RDS db.t2.micro MySQL instance
  • (1) Windows EC2 t2.micro instance
  • (1) 10GB SSD EBS volume
  • (1) 20GB RDS db.t2.small MS SQL BYOL instance
  • (1) Windows EC2 t2.micro instance
  • (1) 10GB SSD EBS volume
  • (1) 20GB RDS db.m1.small MS SQL Standard instance
Small Website
  • (1) Linux EC2 t2.medium instance
  • (1) 100GB SSD EBS volume
  • (1) 20GB RDS db.m1.small MySQL instance
  • (1) Windows EC2 t2.medium instance
  • (1) 100GB SSD EBS volume
  • (1) 20GB RDS db.m1.small MySQL instance
  • (1) Windows EC2 t2.medium instance
  • (1) 100GB SSD EBS volume
  • (1) 20GB RDS db.m1.small MS SQL BYOL instance
  • (1) Windows EC2 t2.medium instance
  • (1) 100GB SSD EBS volume
  • (1) 20GB RDS db.m1.small MS SQL Standard instance
Mid-Size Website
  • (2) Linux EC2 m1.small instances
  • (1) 300GB SSD EBS volume
  • (1) 20GB RDS db.m1.small MySQL instance
  • (2) Windows EC2 m1.small instances
  • (1) 300GB SSD EBS volume
  • (1) 20GB RDS db.m1.small MySQL instance
  • (2) Windows EC2 m1.small instances
  • (1) 300GB SSD EBS volume
  • (1) 20GB RDS db.m1.small MS SQL BYOL instance
  • (2) Windows EC2 m1.small instances
  • (1) 300GB SSD EBS volume
  • (1) 20GB RDS db.m1.small MS SQL Standard instance
Large Web Site
  • (4) Linux EC2 m1.small instances
  • (4) 300GB SSD EBS volumes
  • (1) 20GB RDS db.m1.large MySQL instance
  • (4) Windows EC2 m1.small instances
  • (4) 300GB SSD EBS volumes
  • (1) 20GB RDS db.m1.large MySQL instance
  • (4) Windows EC2 m1.small instances
  • (4) 300GB SSD EBS volumes
  • (1) 20GB RDS db.m1.large MS SQL BYOL instance
  • (4) Windows EC2 m1.small instances
  • (4) 300GB SSD EBS volumes
  • (1) 20GB RDS db.m1.large MS SQL Standard instance

Cost Estimates

Each cell in Table 2 contains a link to a screenshot showing configuration settings from the AWS Simple Cost Calculator. If you enter the same settings shown in the EC2 and RDS links, as well as the settings from the Common column, it should match the estimated monthly bill shown in the Total Cost link. The settings found in the Common column do not change based on the pricing model:

The screenshot in each Total Cost link contains both a monthly cost and a one-time upfront cost. From these, you can calculate the hosting cost for one year. This is the value shown in blue text in Table 3 and will be the basis for all cost comparisons:

Table 3
Cost Estimates for One Year of AWS Web Hosting1
 Linux/MySQLWin/MySQLWin/MS SQL BYOLWin/MS SQL SE
 Upfront1 Month1 YearUpfront1 Month1 YearUpfront1 Month1 YearUpfront1 Month1 Year
Free Usage WebsiteOn-Demand$0$40$480$0$44$528$0$83$996$0$956$11,472
1 Year Upfront (Partial)$132$18$348$152$20$392$330$34$738$2,890$375$7,390
1 Year Upfront (Full)$262$7$346$302$7$386$649$7$733$7,158$7$7,242
Small WebsiteOn-Demand$0$133$1,586$0$146$1,752$0$197$2,364$0$1,002$12,024
1 Year Upfront (Partial)$366$51$978$445$58$1,141$529$89$1,597$3,039$398$7,815
1 Year Upfront (Full)$751$18$967$909$18$1,125$1,352$18$1,568$7,452$18$7,668
Mid-Size WebsiteOn-Demand$0$272$3,264$0$317$3,804$0$368$4,416$0$1,173$14,076
1 Year Upfront (Partial)$492$165$2,472$576$194$2,904$660$225$3,360$3,170$534$9,578
1 Year Upfront (Full)$928$127$2,452$1,354$127$2,878$1,797$127$3,321$7,897$127$9,421
Large WebsiteOn-Demand$0$927$11,124$0$1,017$12,204$0$1,200$14,400$0$2,093$25,116
1 Year Upfront (Partial)$1,478$595$8,618$1,646$654$9,494$1,980$770$11,220$4,638$1,089$17,706
1 Year Upfront (Full)$3,027$461$8,559$3,879$461$9,411$5,580$461$11,112$11,928$461$17,460

With this set of cost estimates, let’s take a look at the questions from the beginning of this post:

  • What amount should I expect to pay to host this site with the same AWS instances when I'm no longer eligible for the free usage tier?
  • Since this site is running on a LEMP stack, the hosting costs without the benefits of the free usage tier would be:

    Pricing ModelUpfront CostMonthly CostOne Year TotalMonthly Avg.
    On-Demand$0$40$480$40.00
    1 Year Upfront (Partial)$132$18$348$29.00
    1 Year Upfront (Full)$262$7$346$28.83
  • Given the light specs of the t2.micro instance (1CPU/1GiB RAM), what would it cost to host a site that requires more capacity? Or a large web application that handles thousands of simultaneous connections?
  • It would cost approximately $1600/year to host the example "Small Website" using Linux/MySQL instances with On-Demand pricing, but less than $1000/year with a 1 year contract and $366 paid upfront. This would result in a monthly hosting bill of $51, which sounds very reasonable to me.

  • How much more would it cost to host any of these websites with a Windows/MSSQL toolchain versus the Linux/MySQL I'm currently using?
  • How much cheaper is it to pay partially or for an entire year of service upfront rather than the On-Demand Instance rate?
  • The general trends from Table 3 are obvious: Committing to a year of service reduces your costs substantially, while choosing Windows or MS SQL increases costs. We want to dive further into these trends, however. Let's start by examining the savings from using Linux/MySQL instances compared to the three Windows flavors.

Cost Savings from Linux/MySQL

It’s simple to see from Table 3 that hosting your website with a Linux/MySQL server is the best way to go in terms of cost. This is entirely expected since Linux and MySQL are free, open-source software while Windows and MS SQL are paid, licensed software.

Before capturing the data, I underestimated how much a MS SQL license would cost and overestimated the cost of a Windows license. I was surprised by the small increase in price between Linux/MySQL and Windows/MySQL, and similarly surprised by the large increase between Windows/MS SQL BYOL and Windows/MS SQL SE. I had assumed that bringing your own license (Windows/MS SQL BYOL) would end up with a similar price to using MySQL (Windows/MySQL).

I was expecting the Windows/MS SQL Standard Edition (SE) hosting costs to be the most expensive, but approximately $11,500 for 1 year at On-Demand rates ($615/month when including the partial upfront payment at the Reserved Instance rate) was far more than I would have guessed. Keep in mind, this is for the t2.micro instance types which are included with the Free Usage Tier.

I wanted to visualize the money saved by choosing Linux/MySQL comparted to the Windows options. I started by noting the money saved for every Windows estimate in Table 3 as compared to the Linux/MySQL estimate for the same website size and pricing model, and then calculated the savings as a percentage of the yearly cost of the Windows plan. These calculations ($ Saved and % Saved, in blue and green text, respectively) are shown in Table 4:

Table 4
1 Year Cost Savings with Linux/MySQL Toolchain
 Free Tier WebsiteSmall WebsiteMid-Size WebsiteLarge Website
 1 Year$ Saved% Saved1 Year$ Saved% Saved1 Year$ Saved% Saved1 Year$ Saved% Saved
On-DemandLinux/MySQL vs$480  $1,586  $3,264  $11,124  
Win/MySQL$528$489%$1,752$16610%$3,804$54014%$12,204$1,0809%
Win/MS SQL BYOL$996$51652%$2,364$77833%$4,416$1,15226%$14,400$3,27623%
Win/MS SQL SE$11,472$10,99296%$12,024$10,43887%$14,076$10,81277%$25,116$13,99256%
1 Year (Partial Upfront)Linux/MySQL vs$348  $978  $2,472  $8,618  
Win/MySQL$392$4411%$1,141$16314%$2,904$43215%$9,494$8769%
Win/MS SQL BYOL$738$39053%$1,597$61939%$3,360$88826%$11,220$2,60223%
Win/MS SQL SE$7,390$7,04295%$7,815$6,83788%$9,578$7,10674%$17,706$9,08851%
1 Year (All Upfront)Linux/MySQL vs$346  $967  $2,562  $8,559  
Win/MySQL$386$4010%$1,125$15814%$2,878$42615%$9,411$8529%
Win/MS SQL BYOL$733$38753%$1,568$60138%$3,321$86926%$11,112$2,55323%
Win/MS SQL SE$7,242$6,89695%$7,668$6,70187%$9,421$6,96974%$17,460$8,90151%

Table 4 shows that choosing Linux and MySQL to host my website is $516 cheaper each year than Windows/MS SQL BYOL. The savings are nearly $11,000 if I do not have a license for MS SQL Standard Edition.

Next, I wanted to know if these savings changed as website size increased. To visualize this, for each website configuration, I took the average of the % Saved for all pricing models and plotted the data for each OS/database configuration. See Chart 1:

Cost Estimates for Hosting Small, Medium and Large Websites with AWS

Figure 1 - Web Host Cost Savings with Linux/MySQL

It turns out that the relative cost savings decrease as the size of your website increases. For the instance types included with the free tier, using Linux/MySQL is 95% cheaper than using MS SQL SE, but for the large website, the Linux/MySQL is only 53% cheaper.

This makes sense to me, since the large website is using EC2 instances with much greater CPU and memory capacity, as well as larger SSD volumes. These resources would represent a much larger portion of the monthly costs than the EC2 instances included with the free tier, and thus the licensing costs would be a smaller portion.

It is also interesting that the cost savings compared to Windows/MySQL do not behave in the same way as the pricing for MS SQL. I believe this shows that Amazon charges (roughly) a flat 10-15% surcharge for Windows, regardless of the instance type.

Cost Savings from Windows/MySQL

After realizing I had underestimated how much MS SQL would increase hosting costs, I decided to calculate the cost savings for Windows/MySQL compared to the MS SQL options in the same way I had done for Linux/MySQL:

Table 5
1 Year Cost Savings with Windows/MySQL Toolchain
 Free Tier WebsiteSmall WebsiteMid-Size WebsiteLarge Website
 1 Year$ Saved% Saved1 Year$ Saved% Saved1 Year$ Saved% Saved1 Year$ Saved% Saved
On-DemandWin/MySQL vs$528  $1,752  $3,804  $12,204  
Win/MS SQL BYOL$996$46847%$2,364$61226%$4,416$61214%$14,400$2,19615%
Win/MS SQL SE$11,472$10,94495%$12,024$10,27285%$14,076$10,27273%$25,116$12,91251%
1 Year (Partial Upfront)Win/MySQL vs$392  $1,141  $2,904  $9,494  
Win/MS SQL BYOL$738$34647%$1,597$45629%$3,360$45614%$11,220$1,72615%
Win/MS SQL SE$7,390$6,99895%$7,815$6,67485%$9,578$6,67470%$17,706$8,21246%
1 Year (All Upfront)Win/MySQL vs$386  $1,125  $2,878  $9,411  
Win/MS SQL BYOL$733$34747%$1,568$44328%$3,321$44313%$11,112$1,70115%
Win/MS SQL SE$7,242$6,85695%$7,668$6,54385%$9,421$6,54369%$17,460$8,04946%
Cost Estimates for Hosting Small, Medium and Large Websites with AWS

Figure 2 - Web Host Cost Savings with Windows/MySQL

The trend for these savings looks exactly like the trend for Linux/MySQL, only shifted down by 8-10%, which makes sense since this shift would represent the flat “surcharge” I noted at the end of the previous section.

Cost Savings from Reserved Instance Rates

There is only one question remaining from my original list: How much cheaper is it to pay partially or for an entire year of service upfront rather than the On-Demand Instance rate? Looking at Table 3, I immediately noticed there is almost no reason to pay the full amount upfront. Across the board, the estimated cost is only $5-10 cheaper than paying the partial amount.

You can see the % Savings for each pricing model and website configuration in Table 6:

Table 6
Cost Savings When Paying Reserved Instance Rates
 Linux/MySQLWin/MySQLWin/MS SQL BYOLWin/MS SQL SE
 1 Year$ Saved% Saved1 Year$ Saved% Saved1 Year$ Saved% Saved1 Year$ Saved% Saved
Free Usage WebsiteOn-Demand$480  $528  $996  $11,472  
1 Year Upfront (Partial)$348$13228%$392$13626%$738$25826%$7,390$4,08236%
1 Year Upfront (Full)$346$13428%$386$14227%$733$26326%$7,242$4,23037%
Small WebsiteOn-Demand$1,586  $1,752  $2,364  $12,024  
1 Year Upfront (Partial)$978$60838%$1,141$61135%$1,597$76732%$7,815$4,20935%
1 Year Upfront (Full)$967$61939%$1,125$62736%$1,568$79634%$7,668$4,35636%
Mid-Size WebsiteOn-Demand$3,264  $3,804  $4,416  $14,076  
1 Year Upfront (Partial)$2,472$79224%$2,904$90024%$3,360$1,05624%$9,578$4,49832%
1 Year Upfront (Full)$2,452$681225%$2,878$92624%$3,321$1,09525%$9,421$4,65533%
Large WebsiteOn-Demand$11,124  $12,204  $14,400  $25,116  
1 Year Upfront (Partial)$8,618$2,50623%$9,494$2,71023%$11,220$3,18022%$17,706$7,41030%
1 Year Upfront (Full)$8,559$2,56523%$9,411$2,79323%$11,112$3,28823%$17,460$7,65631%

For some reason, Amazon does not give a larger incentive for paying the entire amount upfront. This is the case even when full upfront cost is thousands of dollars greater than the partial amount.

I again created a graph to show this by taking the average of the % Savings for all website configurations, for each OS/database combination:

Cost Estimates for Hosting Small, Medium and Large Websites with AWS

Figure 3 - Cost Savings with Reserved Instance Pricing

Summary

I hope this post helps you understand how the cost of hosting a website with AWS is impacted by the choice of OS, database type and pricing model. I know that my example websites may not be applicable to your application, causing a significant difference in the hosting costs.

If you have any feedback for how to improve these estimates, please let me know in the comments!