TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Ask HN: How does Hacker News avoid (successful) DDoS attacks?

14 pointsby codesectionsover 2 years ago
Hacker News has an API¹ that doesn&#x27;t require authentication and doesn&#x27;t have a rate limit. Naively, that seems like a perfect recipe for DDoS attacks. Yet HN is typically a very reliable site. So what&#x27;s the secret?<p>Fn 1: https:&#x2F;&#x2F;github.com&#x2F;HackerNews&#x2F;API

6 comments

capablewebover 2 years ago
It does have a rate limit, it&#x27;s just very very high. I&#x27;ve hit it sometime when trying to download every single item since day 0. But it&#x27;s very lenient, you have to run multiple threads downloading as fast as they can in order to hit it.<p>The API is not hosted by HN&#x2F;Ycombinator themselves. If I recall correctly, it was initially hosted by Firebase which is&#x2F;was a company seed-funded by Ycombinator. It (Firebase) is now a part of Google, so I guess you could say Google is hosting the HN API now.<p>With that, comes everything they are doing to prevent malicious ddos attacks.
评论 #34002144 未加载
Archipelagiaover 2 years ago
So this might be naive, but... what interest would someone have in taking down HN?<p>Like, people with skills to run an attack are also more likely to actually enjoy participating here. It&#x27;d be like someone trying to take down Stack Overflow. Even if you can do that – especially if you&#x27;re the kind of person who could do that – you&#x27;d probably be shooting yourself in the foot, right?
评论 #34001699 未加载
评论 #34002872 未加载
hayst4ckover 2 years ago
You can hit the rate limit, just open 50 tabs and try to load them all at once. You will get IP banned, likely if there are a lot of cache-miss queries (querying old pages rather than recent ones).<p>There are many services you can use that will filter traffic and prevent DDoS. It&#x27;s relatively easy to shift traffic to them if there is a problem.<p>Lastly the content of HN is almost entirely text, high read, very low write. Nearly all writes are behind an account, signup can be protected by a captcha or turned off entirely. The architecture means that reads can be cached, and the caching, serving, and traffic layers (assuming they are there) can likely scale horizontally nearly unbounded.<p>Then hacker news is full of tech folks who would probably enjoy investigating a DDoS.<p>DDoSing seems high risk low reward.
trillicover 2 years ago
Rate limiting, caching, very little code being run for each request, overkill hosting, most data being accessed is likely already in RAM, etc.
anshumankmrover 2 years ago
IP based rate limiting probably (?)
评论 #34001953 未加载
rosndover 2 years ago
HN doesn&#x27;t attract many DDoS attacks, most websites don&#x27;t attract any DDoS attacks.<p>Historically HN has not been hosted on infrastructure that would be particularly resistant to DDoS attacks, nobody has been DDoSing it.