Live data from Hacker News

Self-hosting a blog for cheap and lazy devs

sphuff.com

61–70 of 74 posts

Re: Self-hosting a blog for cheap and lazy devs

#61

Anything that starts with "Install Docker" will not be cheap or easy

This is exactly how far I got in before my "No fucking way" alarm went off. If you want to be truly cheap and lazy use github pages (free), static html (maybe with a markdown converter), and Disqus iframes for comments.

I do this and it works, with the slight tweak that mine's on s3.

But yeah, zero running code is a really great thing.

Re: Self-hosting a blog for cheap and lazy devs

#62

Earlier quoted context omitted.

Ding ding ding, we have a winner! This is exactly the process I landed on this week when I decided to start a blog. There's literally nothing cheaper or more convenient (or resume-appropriate, since I already share my github) than github pages. Generating a static site is almost trivial (I landed on using Hugo, but a bunch of solutions are just as easy). To take the laziness a step further I use emacs and org-mode an…

Fair warning: keep up to date with your Hugo version locally, or use a set version in GitHub Pages. I'm using Gitlab Pages with latest version of Hugo pulled by default. I don't post as much as I did, and have twice had to spend over an hour getting a theme updated for the latest version of Hugo since I didn't update my version and there's been breaking changes. Outside of that, Hugo is fantastic. Good luck with your…

I have really struggled with Hugo’s organizational structure, and for some reason I always end up with pages that are supposed to be lists of posts being completely blank for no reason. No debug messages or anything. I would have to just clone the repo and start stepping through which I do not care to do.

Hugo’s insistence that you have to have a theme is infuriating. I don’t want a theme, I want html and tiny bit of CSS

I’ve tried three times to switch over and it all ends in frustration. It amazes me that I just can’t wrap my mind around it, or just can’t let go and have it force me into it’s opinions about how to structure my site. It's completely possible that I'm just an idiot.

Have always just gone back to Jekyll.

My site is really simple too.

Re: Self-hosting a blog for cheap and lazy devs

#64
post #51

I use Hugo ( https://gohugo.io/ ) to generate static pages and host them on Amazon S3, with CloudFront on top of it for fast delivery. AWS also provides a free SSL certificate, and DNS with Route53. I couldn't be happier with the setup: it's cheap, fast, requires zero maintenance and pretty much never goes down. Cost is close to nil: the most expensive part is for Route53 at $0.50 per Hosted Zone, and then S3+CloudFr…

The only problem with that setup is if a post goes viral CloudFront will cost you a pretty penny. I had one post with ~1MB of assets that was read (IIRC) 70k times in a month and got an ~$80 bill. I’ve since switched to Cloudflare.

The AWS Calculator[1] reports that 70 GB (70k times 1 MB) of transfer out of CloudFront costs ~$3 and another 70 GB to the origin costs about another $3 – this would only be the case if the 1 MB was dynamically generated. The free tier is 50 GB and 2 million requests per month, and beyond that it’s ~0.085/GB in the US so 70 GB would cost 70 * 0.085 = $5.95. You also need to count $0.01 per 10k HTTPS requests, or $0.07 for 70k.

I'm not sure how you got this bill, none of these numbers are anywhere near $80.

[1] https://calculator.s3.amazonaws.com/index.html

Re: Self-hosting a blog for cheap and lazy devs

#65
post #51

I use Hugo ( https://gohugo.io/ ) to generate static pages and host them on Amazon S3, with CloudFront on top of it for fast delivery. AWS also provides a free SSL certificate, and DNS with Route53. I couldn't be happier with the setup: it's cheap, fast, requires zero maintenance and pretty much never goes down. Cost is close to nil: the most expensive part is for Route53 at $0.50 per Hosted Zone, and then S3+CloudFr…

If you're just hosting purely static assets why not use a free hosting with GitHub pages and a custom domain? It comes with free SSL (now) and I assume it could handle all sorts of traffic spikes. I might not be aware of any major downsides so I'm curious why people decide to use a paid (even if it's super cheap) option. I believe also Gitlab offers similar options.

I've had poor experiences in the past with GitHub pages, with pages failing to build or hosting being terribly slow. This was years ago though, things may have changed since then.

That said, I can still count 9 occurrences of degraded performance for a total of 16 hours and 40 minutes in the past 90 days for GitHub pages on https://www.githubstatus.com/ – as a matter of fact performance is shown as degraded right now. That's pretty terrible.

Re: Self-hosting a blog for cheap and lazy devs

#66
post #57
post #39

Earlier quoted context omitted.

I see this a lot with redis in docker compose as well. I've even done it by mistake. Also why the heck doesn't redis have auth by default. It's so ridiculously easy to get "hacked" and inadvertently run a crypto miner.

Can you run a crypto miner as a lua script in Redis? That is actually kinda cool tbh. You'd notice pretty quickly since Redis won't respond anymore.

Little more complex than that. They issue a command that ends up downloading a bunch of shell scripts and goes from there. Does a lot of other nasty things too like trying to steal any ssh key on the machine to presumably use those machines to mine.

Luckily running inside of docker prevents a lot of that by default.

It is very noticeable though when you log into your dev server and the cpu is pegged at 100%.

I copied some of what it did here: https://gist.github.com/dawnerd/50915749d05d865025b447d5941f...

Re: Self-hosting a blog for cheap and lazy devs

#67
post #64

Earlier quoted context omitted.

The only problem with that setup is if a post goes viral CloudFront will cost you a pretty penny. I had one post with ~1MB of assets that was read (IIRC) 70k times in a month and got an ~$80 bill. I’ve since switched to Cloudflare.

The AWS Calculator[1] reports that 70 GB (70k times 1 MB) of transfer out of CloudFront costs ~$3 and another 70 GB to the origin costs about another $3 – this would only be the case if the 1 MB was dynamically generated. The free tier is 50 GB and 2 million requests per month, and beyond that it’s ~0.085/GB in the US so 70 GB would cost 70 * 0.085 = $5.95. You also need to count $0.01 per 10k HTTPS requests, or $0.0…

OK, I was off quite a bit and the total of all assets on the page is 27MB. That's mostly due to several HD pics on the page and one 2-second soundless looping MP4.

The total CloudFront bill was $87.65, the bulk being $74.98 spent in North America (2.5M requests @ $2.52, 852.518 GB data transferred @ $72.46). Those prices are as of March 2019. Doing that math that's only 31.5K page loads in North America (my 70K view number is from Google Analytics worldwide and may have straddled months, or counted re-views, I dunno).

Now, I remember running those pics through TinyJPG so they are as compressed as possible. And I could probably add some kind of JavaScript lazy loading library to only load images as users scroll down to them. Or, I could just use Cloudflare and not think about it. /shrug

Re: Self-hosting a blog for cheap and lazy devs

#68

Anything that starts with "Install Docker" will not be cheap or easy

I host two small websites on my $5 DO droplet, and I use Docker to keep everything its own space. The entire deployment process if I wanted to start with a brand new VPS is about 15 minutes. I think Docker makes my deployments a breeze, and it hasn't forced me to cough up any extra money.

Re: Self-hosting a blog for cheap and lazy devs

#69
post #45

Anything that starts with "Install Docker" will not be cheap or easy

I stopped reading right there. Step one is "install apache", if you're going to be serving a simple website.

I moved my droplet from apache to nginx because apache was a resource hog on that tiny droplet. Site would be unresponsive 2-3x per year because OOM.

Re: Self-hosting a blog for cheap and lazy devs

#70
post #32
post #16

I migrated away from Wordpress to github pages and Jekyll... https://wade.be/2016/01/30/welcome-to-jekyll.html Can’t get any easier, cheaper or lazier than that.

> Wordpress is bloated. It won’t even run on a basic free DigitalOcean instance. Woah, does it use an obscene amount of RAM or what? It's been a while since I used it. (Also, I think you meant the cheapest Droplet using the free $100 credit? I don't think there is a free tier. Would be nice tho :)

No, it doesn't. I run three sites on a $5 1GB VM and its rare to see over half the memory in use (aside from cache).
Post reply on HN