The Price of Idiocy

July 11, 2022

The Price of Idiocy

Spending far more per month on my website than I should

I’ve been running a website of my own in some shape or form since around 2016. In that time, I’ve ran it on various hosting providers in various configurations. Ultimately my website has spent the most of its lifetime inside a Docker container. That Docker container, has been an Nginx base with a custom config file that would strip off the .html of the files of my website before serving it to the user.

Why did I do this? Well I’ve always felt that the links with the file extension in them was a bit unprofessional or messy. If you use something like WordPress for your website, it will do this for you. I on the other hand, use Jekyll to generate my website content. So, the generated output of the Jekyll website would be static HTML files. So, I elected to implement the fix on a web server since it was rather well documented on the Internet. I got it implemented and that’s how I ran my website for quite some time, generally on a Kubernetes cluster.

The rather obvious problem if you have not detected it yet, is that this can be quite expensive. In the Kubernetes cluster days, I felt it was fine since I was using that cluster for multiple applications, however when I stopped running Kubernetes back in 2021, I needed another solution. That solution, ended up with running my website on AWS Fargate and using an Application Load Balancer to route traffic, all built with the AWS Copilot CLI. This worked fine, but if you do some math you quickly realise that this website was costing me anywhere from 25 to 30 EUR per month. For a static website, that’s just insane.

So, I needed to look at solutions. Doing more research online and talking on some Discord forums, it was mentioned that S3 can handle serving files without .html on the end. Nonsense I thought, I tried this years ago I said to myself. Of course, years ago, I did not have as much experience as I did now. So, I collected a few articles on the topic, attempted it with a basic test and what do you know, it actually worked.

The mix of emotions I felt was interesting. I was extremely impressed that this actually worked, but I was also annoyed at how much money I had wasted over the years. I was also extremely happy at how much money I would be saving, even more so now that AWS got more generous with their free tiers. All that was left for me to do, was to tweak the Jekyll build generator output to respect the structure that S3 was expecting and making sure CloudFront worked with the new files. I was also building a lot of this with Terraform, which was nice for a change.

In the end now, as versus the 25 - 30 EUR per month range I had before, the website now costs in the order of cents to run. The single most expensive thing is just the Route 53 Hosted Zone. I am conscious that with the consumption based model of S3 and CloudFront costs could very easily increase dramatically, but with some proper billing alerts in place, it’s something I will be informed of if it ever becomes an issue. So yeah, being not the smartest cost me some money, but it definitely provided learning opportunities in a very roundabout way and I’m better off because of it.

Thank you!

You could of consumed content on any website, but you went ahead and consumed my content, so I'm very grateful! If you liked this, then you might like this other piece of content I worked on.

When I talked about Copilot originally

Photographer

I've no real claim to fame when it comes to good photos, so it's why the header photo for this post was shot by Thomas Jensen . You can find some more photos from them on Unsplash. Unsplash is a great place to source photos for your website, presentation and more! But it wouldn't be anything without the photographers who put in the work.

Find Them On Unsplash

Support what I do

I write for the love and passion I have for technology. Just reading and sharing my articles is more than enough. But if you want to offer more direct support, then you can support the running costs of my website by donating via Stripe. Only do so if you feel I have truly delivered value, but as I said, your readership is more than enough already. Thank you :)

Support My Work

GitHub Profile

Visit My GitHub

LinkedIn

Connect With Me

Support my content

Support What I Do!

My CV / Resume

Download Here

Email

contact at evanday dot dev

Client Agreement

Read Here