4 ms·
I know. I wasn't actually expecting to hit front-page. Trying to reinforce it best I can.
by dsmmcken 4y ago
I know. I wasn't actually expecting to hit front-page. Trying to reinforce it best I can.
- brundolf 4y agoFwiw, in my experience you don't actually need a CDN just to survive HN. It may be enough to just make sure you're not hitting a DB on every request; ideally you'd be caching the HTML output wholesale (via static site generator or otherwise) For reference: with cached HTML, my single Node.js process running on Heroku's cheapest tier has weathered the front page multiple times without breaking a sweat
- knicholes 4y agoRight, like something like Varnish.
- brundolf 4y agoHadn't heard of Varnish, but yeah, it looks like a good solution the OP could probably layer over their current setup without too much trouble
- wyager 4y agoI switched backends a bunch of times because everything I tried (Go stdlib HTTP, Tornado, etc.) kept getting taken out whenever I would hit the front page, either due to CPU overload or some sort of resource leak. I ended up using Warp+Wai+Servant (https://github.com/yesodweb/wai https://github.com/yesodweb/wai) and it has been smooth sailing since then off my $3/mo VPS. It can take thousands of req/sec without flinching (which is higher than what you see from top of HN - that maxes out at a few hundred req/s).
- layer8 4y agoDid you use some software/service for load-testing the alternatives?
- wyager 4y agoYes, I first tested locally with httperf and some other tools. I took it as a good sign when the load testing tools crashed before my server did. Then, I found a few services by searching for something like "website load test" and using their free tier (which would typically generate something like a few hundred req/sec - sufficient to simulate HN).
- mahathu 4y agoWhat VPS are you using and can you recommend it?
- wyager 4y agoVultr. They have been totally solid for me. Nothing fancy - just a reliable cloud VM. Have had no reason to look for alternatives for web hosting.
- pyrolistical 4y agoRight. So a CDN?
- brundolf 4y agoA CDN is its own thing- it's distributed across a provider; it can't just be served off a simple box. It requires having or gaining familiarity with a specific provider, as well as other constraints like you have to statically export to the file system (can't just cache responses in memory), and you can't have any dynamic content without standing up a separate server, etc Makes sense for a lot of things, but it comes with downsides, especially for hobbyists! I've found I prefer sticking with a simple server for my website, and OP might find it's easier to do that too
- jedberg 4y agoThat's not at all true. A CDN is a content delivery network. There is nothing that says it isn't a network of a single host on the same machine as the original content. It's just a cache that returns content faster than the original content.
- kortex 4y agoNope, that's just a proxy/cache. > A content delivery network, or content distribution network, is a geographically distributed network of proxy servers and their data centers. The goal is to provide high availability and performance by distributing the service spatially relative to end users. Emphasis mine. CDN implies some sort of edge-hosting topology (or at least more-proximal than the main servers).
- jedberg 4y agoNot sure why you think CDN implies geographically distributed edge hosting. Are you getting that from Cloudflare's marketing? A company that sells a geographically distributed network?
- TremendousJudge 4y agoAt that point, why not just have a static blog hosted on an AWS bucket?
- brundolf 4y agoFor me: it's less to manage, it's less to learn (AWS is a nightmare from my perspective), and I enjoy other benefits like the fact that one codebase can generate and then serve up the site, and the fact that it's vendor-agnostic (just clone/npm install/run). Also allows easy customization of headers and redirects, allows for the odd dynamic route, and makes local dev/previewing super simple OP may or may not feel the same! Just wanted to communicate that a simple server can definitely do the job
- dsmmcken 4y agoFor reference, it's a fully static site on a low-end shared host. The post had quite a few images, which were pngs from DALL-E, but I've just now recompressed as smaller jpg.