7 ms·
Thanks for hugging my site to death! It's hosted on a $5 DO droplet and I'm honored to have this problem. https://archive.ph/AVbPV https://archive.ph/AVbPV
by tjwds 4y ago
Thanks for hugging my site to death! It's hosted on a $5 DO droplet and I'm honored to have this problem. https://archive.ph/AVbPV https://archive.ph/AVbPV
- anonimou 4y agoHey. Nice post. I was thinking about this same problem for a couple of days. Another question I have is: do we have a higher number of top-level comments on a given number of months or not?
- DeathArrow 4y agoNow you can write another article about how you optimized the site to handle HN traffic. :)
- russellendicott 4y agoI love this idea: "Cheapest way to run a static site that can handle hugs of death".
- eatonphil 4y agoDo you serve static files? Static file server on a $5 DO droplet should handle the HN front page. There's also free tiers on many CDNs like Fastly/Cloudflare. Github Pages is also free.
- tjwds 4y agoI used to use zola hosted on Github Pages, but I wanted to improve the publishing workflow, and WordPress was a good fit for that. (Notes on the migration here: https://blog.joewoods.dev/technology/technical-notes-on-migrating-from-zola-to-wordpress/ https://blog.joewoods.dev/technology/technical-notes-on-migr...)
- eatonphil 4y agoCheck out this thread for recommendations on static site generator plugins on top of Wordpress. Best of both worlds for folks who want high-level publishing. https://news.ycombinator.com/item?id=31396961 https://news.ycombinator.com/item?id=31396961
- ushakov 4y agoyou don't even need those a cache with long-enough TTL will do the magic for you https://mish.co/posts/always-cache-your-website/ https://mish.co/posts/always-cache-your-website/
- deleted 4y ago[deleted]
- iampims 4y agoA (local) cache is mostly useful for repeat visitors, not for thousands of unique visitors unless you use a CDN.
- ushakov 4y agofunny to hear that i actually migrated from Wordpress to Zola
- tedmiston 4y agoPutting the Cloudflare CDN free plan in front should solve the hug of death problem. https://www.cloudflare.com/performance/ensure-application-availability/ https://www.cloudflare.com/performance/ensure-application-av...
- freedomben 4y agoI run a few big sites on WordPress, and would totally recommend you use the simply static plugin, and configure nginx to serve those cached files directly so it never hits php. I also usually put cloudflare in front as well, but you can have a screaming fast wordpress site that scales really far by itself without it just with that trick. If you need some dynamism, w3 total cache is also a great choice. If you're not an nginx hacker, there are some great examples around the internet. This page is pretty helpful: https://wordpress.org/support/article/nginx/ https://wordpress.org/support/article/nginx/
- spyder 4y agoEven DO has their free tier for static hosting with global CDN and DDoS mitigation: https://www.digitalocean.com/community/tutorials/how-to-deploy-a-static-website-to-the-cloud-with-digitalocean-app-platform https://www.digitalocean.com/community/tutorials/how-to-depl... Looks like the free one has only 1GB outbound transfer which wouldn't be enough for a single hug, but the $5/month one has 40GB which might be enough for a hug with text only content.
- andrewxdiamond 4y agoFor simple static sites like this, sticking a default Cloudflare stack in front helps a lot
- coip 4y agoyou’d (I’d) think ~managed cdn serving an s3/blob origin would be a no brainer. Hell, GitHub pages even: BYODomain, + hosting/automation/cdn… Where’s the free lunch in that line of thinking? which cases are a droplet better in?
- coip 4y ago(Now that I’ve tried to RTFA, it seems homie has a runtime dependence (db?) or something colocated on the host failing? OWASP, right? Having a resource limit reached maybe? Nextjs seems like a cool approach to manage partially ~runtime-dynamic systems like this/cms/etc)
- Frotag 4y agoBeing able to recycle the vps for other self-hosted apps is nice (eg vpn, dns-level adblock, etc). Also not having to learn another tech for something you'd only have to set up once every year or few years.
- paxys 4y agoA $5 DO droplet will easily handle peak HN traffic with a bit of optimization. Set cache headers, cache static assets on the server side (or even better, with an external CDN), or even cache the entire page if there's no dynamic content.
- polote 4y agoEven without optimization. Peak HN traffic is in the 20 req per second order of magnitude
- Laforet 4y agoWithout optimization, Nginx defaults to allowing a maximum of one worker process with 512 connections and 60s timeout. 20 unique visitors per second will lead to 500 errors in less than a minute.
- weird-eye-issue 4y agoAre you assuming each request takes a second, or how long? A blog should return fast enough that this isn't the case Edit: Yes, even WordPress. Unless there are 50 plugins, an unoptimized theme, zero caching, and a resource constrained server.
- Laforet 4y agoIt does not matter how fast the backend is. A persistent HTTP connection will last 60 seconds following the latest client request, unless the browser goes out of its way to explicitly close the connection. P.S. OP's website uses Apache but the same issue of overly conservative limits still apply.
- harikb 4y agoI can’t imagine a case where the browser wouldn’t do the decency of closing a connection.
- mobilio 4y agoAnother link: https://web.archive.org/web/20220608222735/https://blog.joewoods.dev/technology/hackernews-who-is-hiring-top-level-comments-over-time/ https://web.archive.org/web/20220608222735/https://blog.joew...
- soheil 4y agoIt's a static site, no reason for the server not to be able to handle thousands of connections at once with almost no configuration changes with some like Nginx or Apache. Or even a domain which points directly to a S3 bucket. Hope you're not looking at devop roles on who is hiring posts.
- robjan 4y agoIt's a WordPress blog
- deleted 4y ago[deleted]
- lamontcg 4y agoSo the "pullback" seems similar to the one that was seen in pre-pandemic 2019. That about correlates to my impression that this is not the recession.
- mountaineer 4y agoI run https://www.hntrends.com https://www.hntrends.com on a $5/month box and never had a problem with spikes. Generated, static resources all the way.
- jasfi 4y agoThen you need a faster web framework or CMS. Nexus is made with Nim and is designed to be fast (https://github.com/jfilby/nexus https://github.com/jfilby/nexus). But most problems like that can be solved with caching no matter which tech you're using.
- eyelidlessness 4y agoThey were grateful the thing got so much attention, and deferred to other hosts to supplement serving that attention. Not looking for uptime solutions.
- jasfi 4y agoFaster software will always save you time, money and effort.