# How much are you paying for low traffic site?

**URL:** <https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766>\
**Category:** Databases\
**Tags:** ec2, fargate, codepipeline, lightsail, rds, nat-gateway\
**Created:** [January 7, 2024, 4:41pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766 "2024-01-07T16:41:05Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Character\_Ad7544](https://awshq.com/letter_avatar_proxy/v4/letter/c/ee59a6/32.png) [@Character\_Ad7544](https://awshq.com/u/Character_Ad7544)\
**Post date:** [January 7, 2024, 4:41pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766/1 "2024-01-07T16:41:05Z")

</div>

I’m a developer and for my side hustle I started creating a SPA project based on some of the best practices. I chose Fargate, so I could easily scale up in the future. The most basic RDS, added CDN and also had to use NAT Gateway.  
I have two EC2 instances, one for frontend and one for backend and also connected them to Codepipeline. Plus one LightSail to host the blog of site

The total cost for all these with no traffic currently is **$120 per month**.

Could I have chosen a cheaper approach? I currently see two options:  
1- Replacing NAT Gateway with [https://github.com/AndrewGuenther/fck-nat](https://github.com/AndrewGuenther/fck-nat)  
2- I could use Lambdas for hosting the site instead of EC2, but I haven’t seen anyone doing that without encountering more issues.

* * *

**Related discussions:**

- [Is anyone using CodeCommit, CodeBuild, CodeDeploy and CodePipeline?](https://awshq.com/t/is-anyone-using-codecommit-codebuild-codedeploy-and-codepipeline/18034)
- [AWS CodeBuild vs GitHub Actions](https://awshq.com/t/aws-codebuild-vs-github-actions/19821)
- [[ALB + ECS Fargate] ALB health checks cannot reach my containers, so it keeps killing them](https://awshq.com/t/alb-ecs-fargate-alb-health-checks-cannot-reach-my-containers-so-it-keeps-killing-them/16080)
- [fck-nat worth it?](https://awshq.com/t/fck-nat-worth-it/18944)
- [CloudFront VPC Origins with Cognito](https://awshq.com/t/cloudfront-vpc-origins-with-cognito/19446)

---

<div class="post-metadata">

**Author:** ![bryantbiggs](https://awshq.com/letter_avatar_proxy/v4/letter/b/3e96dc/32.png) [@bryantbiggs](https://awshq.com/u/bryantbiggs)\
**Post date:** [January 7, 2024, 4:46pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766/2 "2024-01-07T16:46:13Z")

</div>

If it’s just a SPA, why not S3 and cloudfront? Would be less than $5/month. If you need DB, use dynamodb. You don’t need ec2, RDS, and NAT gateways

---

<div class="post-metadata">

**Author:** ![bryantbiggs](https://awshq.com/letter_avatar_proxy/v4/letter/b/3e96dc/32.png) [@bryantbiggs](https://awshq.com/u/bryantbiggs)\
**Post date:** [January 7, 2024, 4:46pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766/3 "2024-01-07T16:46:51Z")

</div>

> [@bryantbiggs](#):
>
> If it’s just a SPA, why not S3 and cloudfront? Would be less than $5/month. If you need DB, use dynamodb. You don’t need ec2, RDS, and NAT gateways

Also, what’s on the ec2s if you’re using fargate?

---

<div class="post-metadata">

**Author:** ![MinionAgent](https://awshq.com/letter_avatar_proxy/v4/letter/m/e36b37/32.png) [@MinionAgent](https://awshq.com/u/MinionAgent)\
**Post date:** [January 7, 2024, 4:47pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766/4 "2024-01-07T16:47:38Z")

</div>

If you are using EC2, you are not using Fargate. In Fargate you pay only for the running containers, something with 0.25CPU and 0.5RAM cost around 10 USD.

For the database you can run Aurora Serverless, with 0.5 ACU it should be pretty cheap as well. You can build all that with ECS and AWS Copilot which uses an interesting approach to avoid NAT Gateways, it just deploy your tasks with public IPs by default 😛

The other route is the serverless one, you can try Amplify, host the SPA with Amplify Hosting, use Lambda for the APIs and maybe DynamoDB for storage. That’s really cheap for a project or low traffic site, including the free tiers you can probably run it for free.

---

<div class="post-metadata">

**Author:** ![Character\_Ad7544](https://awshq.com/letter_avatar_proxy/v4/letter/c/ee59a6/32.png) [@Character\_Ad7544](https://awshq.com/u/Character_Ad7544)\
**Post date:** [January 7, 2024, 4:49pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766/5 "2024-01-07T16:49:45Z")

</div>

> [@bryantbiggs](#):
>
> If it’s just a SPA, why not S3 and cloudfront? Would be less than $5/month. If you need DB, use dynamodb. You don’t need ec2, RDS, and NAT gateways

I have a backend that process stuff and the react that’s dockerized. Beside changing django to work with dynamodb is such a pain and would require more work.

---

<div class="post-metadata">

**Author:** ![TakeThreeFourFive](https://awshq.com/letter_avatar_proxy/v4/letter/t/779978/32.png) [@TakeThreeFourFive](https://awshq.com/u/TakeThreeFourFive)\
**Post date:** [January 7, 2024, 4:50pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766/6 "2024-01-07T16:50:28Z")

</div>

For a small site with cost being a factor, I would have done this differently.

1. RDS is expensive. I avoid it like the plague for small personal projects. I choose dynamo where possible or occasionally use EC2 instead for hosting an instance.
2. Why are you hosting a front end on its own EC2? Can it be hosted in s3+cloudfront instead?
3. You said you chose fargate, but also ec2 for the backend? What is each doing in this case?
4. Lambda + API gateway is how I do low-cost personal stuff

---

<div class="post-metadata">

**Author:** ![Lip98B](https://awshq.com/letter_avatar_proxy/v4/letter/l/f475e1/32.png) [@Lip98B](https://awshq.com/u/Lip98B)\
**Post date:** [January 7, 2024, 4:51pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766/7 "2024-01-07T16:51:40Z")

</div>

Most cost efficient design I know: cloudfront, S3, API Gateway, dynamodb, Lambda.

You will only pay something if your site has a lot of traffic, most of these services have a huge free tier.

I’m developing my application right now, and I have a full deployed system with this stack, I only pay 50 cents a month because of Route 53 for DNS management.

---

<div class="post-metadata">

**Author:** ![Character\_Ad7544](https://awshq.com/letter_avatar_proxy/v4/letter/c/ee59a6/32.png) [@Character\_Ad7544](https://awshq.com/u/Character_Ad7544)\
**Post date:** [January 7, 2024, 4:55pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766/8 "2024-01-07T16:55:43Z")

</div>

> [@Lip98B](#):
>
> Most cost efficient design I know: cloudfront, S3, API Gateway, dynamodb, Lambda. You will only pay something if your site has a lot of traffic, most of these services have a huge free tier. I’m developing my …

What’s the downside of hosting react on S3 and Cloudfront?  
I chose to not use dynamodb, because backend was with django and it’s too much effort to get it work with dynamo.  
I wasn’t sure about hosting backend on Lambda, as I read there were some issue with using this approach.

---

<div class="post-metadata">

**Author:** ![Lip98B](https://awshq.com/letter_avatar_proxy/v4/letter/l/f475e1/32.png) [@Lip98B](https://awshq.com/u/Lip98B)\
**Post date:** [January 7, 2024, 4:59pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766/9 "2024-01-07T16:59:27Z")

</div>

> [@Character\_Ad7544](#):
>
> What’s the downside of hosting react on S3 and Cloudfront? I chose to not use dynamodb, because backend was with django and it’s too much effort to get it work with dynamo. I wasn’t sure about hosting backend on Lambda, …

React build result is just a file, there is no downside as I see. S3 is the cheapest way to store files on AWS, cloudfront will give you low latency if you want, but in this case we use it just to route traffic to the S3 bucket.

---

<div class="post-metadata">

**Author:** ![Character\_Ad7544](https://awshq.com/letter_avatar_proxy/v4/letter/c/ee59a6/32.png) [@Character\_Ad7544](https://awshq.com/u/Character_Ad7544)\
**Post date:** [January 7, 2024, 5:00pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766/10 "2024-01-07T17:00:04Z")

</div>

> [@TakeThreeFourFive](#):
>
> For a small site with cost being a factor, I would have done this differently. 1. RDS is expensive. I avoid it like the plague for small personal projects. I choose dynamo where possible or occasionally use EC2 instead …

1. It’s all on fargate, fargate underneath uses EC2. just one EC2 for jumpbox. I didn’t consider s3+cloudfront in the beginning cause I didn’t know about it.

4- it is personal project for now, but I’m quitting my job to work on it fully so it might scale up.

---

<div class="post-metadata">

**Author:** ![Lip98B](https://awshq.com/letter_avatar_proxy/v4/letter/l/f475e1/32.png) [@Lip98B](https://awshq.com/u/Lip98B)\
**Post date:** [January 7, 2024, 5:02pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766/11 "2024-01-07T17:02:04Z")

</div>

> [@Character\_Ad7544](#):
>
> What’s the downside of hosting react on S3 and Cloudfront? I chose to not use dynamodb, because backend was with django and it’s too much effort to get it work with dynamo. I wasn’t sure about hosting backend on Lambda, …

About dynamo, you will have to write your own queries, also, designing a NoSQL solution is somewhat different from SQL, which will have a learning curve. You could use aurora serverless, it would reduce your db costs significantly and it’s SQL.

---

<div class="post-metadata">

**Author:** ![wsb\_noob](https://awshq.com/letter_avatar_proxy/v4/letter/w/ce73a5/32.png) [@wsb\_noob](https://awshq.com/u/wsb_noob)\
**Post date:** [January 7, 2024, 5:02pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766/12 "2024-01-07T17:02:35Z")

</div>

less than $1.00 per month (excluding the annual domain renewal which is 10 or 20 i forgot).

- $0.7 hosted zone
- $ nearly free, since so few read/write - dynamodb - switch all table to usage based.
- $ nearly free, since low traffic - aws lambdas + api-gateway - flask deployed with zappa.
- $ nearly free, since not much data - s3.

---

<div class="post-metadata">

**Author:** ![TakeThreeFourFive](https://awshq.com/letter_avatar_proxy/v4/letter/t/779978/32.png) [@TakeThreeFourFive](https://awshq.com/u/TakeThreeFourFive)\
**Post date:** [January 7, 2024, 5:05pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766/13 "2024-01-07T17:05:30Z")

</div>

> [@Character\_Ad7544](#):
>
> 1. It’s all on fargate, fargate underneath uses EC2. just one EC2 for jumpbox. I didn’t consider s3+cloudfront in the beginning cause I didn’t know about it. 4- it is personal project for now, but I’m quitting my job to …

Fargate does not use EC2. Do you mean that you’re running it on ECS with EC2?

S3 and cloudfront will definitely save you money over EC2

Lambda and API gateway will still scale well

---

<div class="post-metadata">

**Author:** ![wsb\_noob](https://awshq.com/letter_avatar_proxy/v4/letter/w/ce73a5/32.png) [@wsb\_noob](https://awshq.com/u/wsb_noob)\
**Post date:** [January 7, 2024, 5:05pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766/14 "2024-01-07T17:05:48Z")

</div>

> [@Lip98B](#):
>
> Most cost efficient design I know: cloudfront, S3, API Gateway, dynamodb, Lambda. You will only pay something if your site has a lot of traffic, most of these services have a huge free tier. I’m developing my …

this is the way! if there is no lambda (or equivalent) then i’d rather just host my shit on prem with a few cheap compact PCs - which is fun at first but this means forever hardware maintenance.

---

<div class="post-metadata">

**Author:** ![pr06lefs](https://awshq.com/letter_avatar_proxy/v4/letter/p/e19adc/32.png) [@pr06lefs](https://awshq.com/u/pr06lefs)\
**Post date:** [January 7, 2024, 5:24pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766/15 "2024-01-07T17:24:20Z")

</div>

I host 3 sites on a 5$ linode. My stack is sqlite+rust+elm frontend. Plus nginx for the cert wrangling and reverse proxy.

---

<div class="post-metadata">

**Author:** ![JLaurus](https://awshq.com/letter_avatar_proxy/v4/letter/j/dec6dc/32.png) [@JLaurus](https://awshq.com/u/JLaurus)\
**Post date:** [January 7, 2024, 5:30pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766/16 "2024-01-07T17:30:59Z")

</div>

What do you mean your frontend is on EC2? Your SPA code is client side code / files. And can be served from a CDN, unless you’re doing server side rendering.

I would stay off EC2 or fargate, especially for a side project. There is no need to go on fargate in-case you need to scale.

It sounds like you already have some type of docker containerisation already so maybe take a look at dumping your existing setup and move to AppRunner [https://aws.amazon.com/apprunner/](https://aws.amazon.com/apprunner/).

RDS does have a free tier for new accounts so maybe looking at using a T2/T3 micro (from memory).

If you can’t move to a serverless model (lambda etc) for whatever reason, you should seriously consider using SQLite for your database, that way you can completely remove RDS costs.

Why do you need a NAT gateway? They cost an absolute fortune. Avoid them unless you have a very specific reason.

A serious suggestion would be to look at using another provider as you dont sound very experienced with AWS and infrastructure, as AWS can quickly become extremely costly for people who are new to it. There are plenty of stories like this.

[Fly.io](http://Fly.io) is a service you could look at using, their pricing is completely clear on what you would pay, and it doesnt stop you from using cloudfront/s3 for static content and storage.

---

<div class="post-metadata">

**Author:** ![luca\_gohan](https://awshq.com/letter_avatar_proxy/v4/letter/l/c4cdca/32.png) [@luca\_gohan](https://awshq.com/u/luca_gohan)\
**Post date:** [January 7, 2024, 5:41pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766/17 "2024-01-07T17:41:40Z")

</div>

As others have said, serverless is way cheaper

---

<div class="post-metadata">

**Author:** ![aimtron](https://awshq.com/letter_avatar_proxy/v4/letter/a/a88e4f/32.png) [@aimtron](https://awshq.com/u/aimtron)\
**Post date:** [January 7, 2024, 5:52pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766/18 "2024-01-07T17:52:23Z")

</div>

SPA to S3 fronted by cloudfront. Backend to fargate and it is optional to deploy in public vs private which means the NAT can technically be removed unless you have specific reasons for its use. I have both styles of deployments (public vs private) and the NAT is going to a large cost

---

<div class="post-metadata">

**Author:** ![HenryTheWireshark](https://awshq.com/letter_avatar_proxy/v4/letter/h/9d8465/32.png) [@HenryTheWireshark](https://awshq.com/u/HenryTheWireshark)\
**Post date:** [January 7, 2024, 5:58pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766/19 "2024-01-07T17:58:20Z")

</div>

> [@TakeThreeFourFive](#):
>
> For a small site with cost being a factor, I would have done this differently. 1. RDS is expensive. I avoid it like the plague for small personal projects. I choose dynamo where possible or occasionally use EC2 instead …

Do you have any code samples you can share showing API Gateway + Lambda? I have a need to get that built pretty soon, but all of the googling I’ve done just shows vendor products to make that integration happen.

---

<div class="post-metadata">

**Author:** ![RickySpanishLives](https://awshq.com/letter_avatar_proxy/v4/letter/r/278dde/32.png) [@RickySpanishLives](https://awshq.com/u/RickySpanishLives)\
**Post date:** [January 7, 2024, 6:00pm UTC](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766/20 "2024-01-07T18:00:47Z")

</div>

> [@Lip98B](#):
>
> Most cost efficient design I know: cloudfront, S3, API Gateway, dynamodb, Lambda. You will only pay something if your site has a lot of traffic, most of these services have a huge free tier. I’m developing my …

This is the appropriate architecture. This will allow you to scale your costs with the popularity of your project and if it DOES become super popular, you can migrate off the dynamic cost solutions onto fixed EC2/Fargate solutions.

[Next page](https://awshq.com/t/how-much-are-you-paying-for-low-traffic-site/17766.md?page=2)
