from Hacker News

Ask HN: How do you prepare for “HN Hug of death”?

by _448 on 4/21/23, 4:23 AM with 10 comments

When a "Show HN" post is created by an app developer, the obvious effect of that is a massive load on the backend server of the app, bringing down the server. I have read posts here on HN, where developers who were unprepared for this spike in server load experienced, what is now well known as, the "HN hug of death".

So how do you prepare for avoiding this fate before creating a "Show HN" post?

  • by rozenmd on 4/21/23, 6:37 AM

    For the frontend: put a CDN in front of it, add caching.

    In my experience, most folks just want to see what the fuss is about, not so much make an account and start using the app. So as long as your post-login experience can take a few users simultaneously, you should be fine.

  • by leandot on 4/21/23, 7:52 AM

    Caching/make the homepage static if possible. I had a project some years ago that had an elastic search backend, adding redis for caching allowed it to run without problems with up to 1000 concurrent users (position 1-10 on HN if I remember right). As someone below pointed out, the majority would want to have a look, not create accounts.
  • by ianpurton on 4/21/23, 7:17 AM

    I use zola a static site generator and deploy the pages (for free) to cloudflare pages.

    So there's no impact on my servers.

    For a product you will get a lot of people from HN reading the landing page but relatively few registrations.

  • by smt88 on 4/21/23, 4:27 AM

    Autoscaling, available on most popular clouds/hosts