Hacker News new | past | comments | ask | show | jobs | submit login

OP here - this is a sidebar but the HN hug was making the page load really slowly (~10s for me) even though the blog part of the site is cached. Anyway, because I'm using kubernetes all it took to fix it was bumping the nodes in my cluster, 4x the replicas, kubectl apply and it's snappy again! All done in about a minute. What an awesome tool kubernetes is.



Please take this comment in good faith because I'm genuinely curious: why do you need a kube managed cluster of N nodes (an now 4x N) to host a static blog? I wonder what works goes on under the hood that this needs such scale.


The blog is just attached to the product site https://boxci.dev, thats the reason for using kube. Should be separately hosted but this was just simpler.

The static blog pages though are all cached via nginx so I was surprised I needed to increase the nodes & relicas. Short answer is I don't know, and will need to investigate, but I suspect it's because the kubernetes node instances themselves are fairly low powered, there's a low cpu limit on nginx, and perhaps nginx is doing a lot of work serving the js bundle to so many simultaneous users, which really should be hosted on a CDN (probably also the blog).


> Should be separately hosted but this was just simpler.

Probably shouldn't. If you are already managing an automated environment, creating another environment that is easier to manage has nearly no upside.

Unless that phrase was meant to use the CDN you talk about later, but again, do you need a CDN to solve the easiest part of your infrastructure? (Or rather, do you have enough traffic so that it isn't the easiest part?)


Yeah my phrasing wasn't that clear there but I essentially meant hosted as in cached on CDN servers, just to reduce load on the nginx instances. Though my best guess at the moment for what was causing things to be slow was just sending the JS bundle to so many simultaneous users. Putting that on a CDN may be enough.


The real short answer is: he doesn't, he could just use Github Pages or similar :-)

I'm guessing he likes to tinker.


To be honest that's not it - as in my sibling comment it's just attaching the blog onto the site was the fastest way to go, given that I wanted to keep it on the same domain. The product just happens to be built on kubernetes already, use of kube is definitely not for the blog. I'm actually pretty surprised that nginx couldn't handle the traffic to be honest. Even with the fairly low resources I'd allocated it. It's just cached static content served right from nginx you're seeing there. Now I've seen that this setup isn't really appropriate (at least without being very expensive!), I'll spend the time to put it onto a CDN


If you're not worried about the privacy & co. stuff, Cloudflare is free and it's probably the best option for you.


Try to add autoscaling. You shouldn't be doing it manual :-)


Yeah, you're totally right and I actually will now! Infra wasn't ready at all for the HN hug. I think I'd had at most 20 simultaneous connections prior to this!


The first time my site ended up on HN, I set up Cloudflare because this community blew my site off the internet pretty quickly.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: