TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

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

14 点作者 codesections超过 2 年前
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 条评论

capableweb超过 2 年前
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 未加载
Archipelagia超过 2 年前
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 未加载
hayst4ck超过 2 年前
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.
trillic超过 2 年前
Rate limiting, caching, very little code being run for each request, overkill hosting, most data being accessed is likely already in RAM, etc.
anshumankmr超过 2 年前
IP based rate limiting probably (?)
评论 #34001953 未加载
rosnd超过 2 年前
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.