Cost Estimates for Hosting Small, Medium and Large Websites with AWS
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?
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:
- OS and database type
- Pricing model
- 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/MySQL | Windows/MySQL | Windows/MS SQL BYOL | Windows/MS SQL SE | |
---|---|---|---|---|
Free Usage Website |
|
|
|
|
Small Website |
|
|
|
|
Mid-Size Website |
|
|
|
|
Large Web Site |
|
|
|
|
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/MySQL | Win/MySQL | Win/MS SQL BYOL | Win/MS SQL SE | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Upfront | 1 Month | 1 Year | Upfront | 1 Month | 1 Year | Upfront | 1 Month | 1 Year | Upfront | 1 Month | 1 Year | ||
Free Usage Website | On-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 Website | On-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 Website | On-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 Website | On-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 | |
11 Year = Upfront + (1 Month * 12) |
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 Model | Upfront Cost | Monthly Cost | One Year Total | Monthly 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 Website | Small Website | Mid-Size Website | Large Website | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 Year | $ Saved | % Saved | 1 Year | $ Saved | % Saved | 1 Year | $ Saved | % Saved | 1 Year | $ Saved | % Saved | ||
On-Demand | Linux/MySQL vs | $480 | $1,586 | $3,264 | $11,124 | ||||||||
Win/MySQL | $528 | $48 | 9% | $1,752 | $166 | 10% | $3,804 | $540 | 14% | $12,204 | $1,080 | 9% | |
Win/MS SQL BYOL | $996 | $516 | 52% | $2,364 | $778 | 33% | $4,416 | $1,152 | 26% | $14,400 | $3,276 | 23% | |
Win/MS SQL SE | $11,472 | $10,992 | 96% | $12,024 | $10,438 | 87% | $14,076 | $10,812 | 77% | $25,116 | $13,992 | 56% | |
1 Year (Partial Upfront) | Linux/MySQL vs | $348 | $978 | $2,472 | $8,618 | ||||||||
Win/MySQL | $392 | $44 | 11% | $1,141 | $163 | 14% | $2,904 | $432 | 15% | $9,494 | $876 | 9% | |
Win/MS SQL BYOL | $738 | $390 | 53% | $1,597 | $619 | 39% | $3,360 | $888 | 26% | $11,220 | $2,602 | 23% | |
Win/MS SQL SE | $7,390 | $7,042 | 95% | $7,815 | $6,837 | 88% | $9,578 | $7,106 | 74% | $17,706 | $9,088 | 51% | |
1 Year (All Upfront) | Linux/MySQL vs | $346 | $967 | $2,562 | $8,559 | ||||||||
Win/MySQL | $386 | $40 | 10% | $1,125 | $158 | 14% | $2,878 | $426 | 15% | $9,411 | $852 | 9% | |
Win/MS SQL BYOL | $733 | $387 | 53% | $1,568 | $601 | 38% | $3,321 | $869 | 26% | $11,112 | $2,553 | 23% | |
Win/MS SQL SE | $7,242 | $6,896 | 95% | $7,668 | $6,701 | 87% | $9,421 | $6,969 | 74% | $17,460 | $8,901 | 51% |
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:
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 Website | Small Website | Mid-Size Website | Large Website | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 Year | $ Saved | % Saved | 1 Year | $ Saved | % Saved | 1 Year | $ Saved | % Saved | 1 Year | $ Saved | % Saved | ||
On-Demand | Win/MySQL vs | $528 | $1,752 | $3,804 | $12,204 | ||||||||
Win/MS SQL BYOL | $996 | $468 | 47% | $2,364 | $612 | 26% | $4,416 | $612 | 14% | $14,400 | $2,196 | 15% | |
Win/MS SQL SE | $11,472 | $10,944 | 95% | $12,024 | $10,272 | 85% | $14,076 | $10,272 | 73% | $25,116 | $12,912 | 51% | |
1 Year (Partial Upfront) | Win/MySQL vs | $392 | $1,141 | $2,904 | $9,494 | ||||||||
Win/MS SQL BYOL | $738 | $346 | 47% | $1,597 | $456 | 29% | $3,360 | $456 | 14% | $11,220 | $1,726 | 15% | |
Win/MS SQL SE | $7,390 | $6,998 | 95% | $7,815 | $6,674 | 85% | $9,578 | $6,674 | 70% | $17,706 | $8,212 | 46% | |
1 Year (All Upfront) | Win/MySQL vs | $386 | $1,125 | $2,878 | $9,411 | ||||||||
Win/MS SQL BYOL | $733 | $347 | 47% | $1,568 | $443 | 28% | $3,321 | $443 | 13% | $11,112 | $1,701 | 15% | |
Win/MS SQL SE | $7,242 | $6,856 | 95% | $7,668 | $6,543 | 85% | $9,421 | $6,543 | 69% | $17,460 | $8,049 | 46% |
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/MySQL | Win/MySQL | Win/MS SQL BYOL | Win/MS SQL SE | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
1 Year | $ Saved | % Saved | 1 Year | $ Saved | % Saved | 1 Year | $ Saved | % Saved | 1 Year | $ Saved | % Saved | ||
Free Usage Website | On-Demand | $480 | $528 | $996 | $11,472 | ||||||||
1 Year Upfront (Partial) | $348 | $132 | 28% | $392 | $136 | 26% | $738 | $258 | 26% | $7,390 | $4,082 | 36% | |
1 Year Upfront (Full) | $346 | $134 | 28% | $386 | $142 | 27% | $733 | $263 | 26% | $7,242 | $4,230 | 37% | |
Small Website | On-Demand | $1,586 | $1,752 | $2,364 | $12,024 | ||||||||
1 Year Upfront (Partial) | $978 | $608 | 38% | $1,141 | $611 | 35% | $1,597 | $767 | 32% | $7,815 | $4,209 | 35% | |
1 Year Upfront (Full) | $967 | $619 | 39% | $1,125 | $627 | 36% | $1,568 | $796 | 34% | $7,668 | $4,356 | 36% | |
Mid-Size Website | On-Demand | $3,264 | $3,804 | $4,416 | $14,076 | ||||||||
1 Year Upfront (Partial) | $2,472 | $792 | 24% | $2,904 | $900 | 24% | $3,360 | $1,056 | 24% | $9,578 | $4,498 | 32% | |
1 Year Upfront (Full) | $2,452 | $6812 | 25% | $2,878 | $926 | 24% | $3,321 | $1,095 | 25% | $9,421 | $4,655 | 33% | |
Large Website | On-Demand | $11,124 | $12,204 | $14,400 | $25,116 | ||||||||
1 Year Upfront (Partial) | $8,618 | $2,506 | 23% | $9,494 | $2,710 | 23% | $11,220 | $3,180 | 22% | $17,706 | $7,410 | 30% | |
1 Year Upfront (Full) | $8,559 | $2,565 | 23% | $9,411 | $2,793 | 23% | $11,112 | $3,288 | 23% | $17,460 | $7,656 | 31% | |
11 Year = Upfront + (1 Month * 12) |
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:
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!