Live data from Hacker News

Let us serve you, but don't bring us down

blog.archive.org

221–230 of 255 posts

Re: Let us serve you, but don't bring us down

#221

Unpopular opinion: Severely rate limit retrieving the files from the website / HTTP endpoint, and loudly point towards downloading the files via torrents. The torrent protocol was meant to relieve this level of server load in mind.

and loudly point towards downloading the files via torrents. By "loudly", perhaps actually redirect to the .torrent instead, for those who trip the rate limit?

A Link header would be more appropriate (maybe with rel="alternate"?)

Re: Let us serve you, but don't bring us down

#222

Earlier quoted context omitted.

Torrents have the habit of disappearing when no users keep them alive. It happened to me enough times to be wary of such solution. If there's a way to keep them alive regardless of interest I'm all for it.

This is what "proof of storage" or "proof of data availability" blockchain networks are for. They use economic incentives to continuously pay nodes a small amount to store some data and keep it available, and the cryptographic sampling mechanism ensures that less popular data must remain in the available dataset for nodes to be paid, even if it is rarely requested in full.

If you are willing to spend money, there is no problem keeping content up with existing technology. Like always, blockchain solutions miss the problem entirely.

Re: Let us serve you, but don't bring us down

#223
post #206

Is there an open-source rate limiter that works well for sites large and small? It just strikes me as surprising that sites are still dealing with problems like this in 2023. The idea that a site is still manually having to identify a set of IP addresses and block them with human intervention seems absolutely archaic by this point. And I don't think different sites have particularly different needs here... basic patt…

I think rate limiting is the wrong approach. If there’s too much load you need to manage the queue

What does "manage the queue" mean? And how would that be better than dropping requests from the source of the abuse?

Re: Let us serve you, but don't bring us down

#224
post #5

I run a system at my employer that occasionally gets scraped by malicious users. It can be used to infer the purchasability of a specific domain, which is a moderately-interesting API endpoint, since that requires talking to domain registries. For a while, nobody cared enough about it to abuse the endpoint. But then we started getting about 40 QPS of traffic. We normally get less than 1. I was keeping an eye on it, b…

I think you could make your requests two step. If somebody wants to access endpoint you might send him a challenge first. Random text. The client must append to the text some other text chosen by him, so that when you calculate sha256 on concatenated text, first byte or two of it will be zeros. To access your actual endpoint client needs to send that generated text and you can check it if it results in the required n…

Because it doesn’t accomplish anything. Things take longer for honest users while botnet abusers don’t even notice that the rented hardware is burning more CPU. Nor does it matter because each request still goes through.

Re: Let us serve you, but don't bring us down

#225

Earlier quoted context omitted.

I think you could make your requests two step. If somebody wants to access endpoint you might send him a challenge first. Random text. The client must append to the text some other text chosen by him, so that when you calculate sha256 on concatenated text, first byte or two of it will be zeros. To access your actual endpoint client needs to send that generated text and you can check it if it results in the required n…

Because it doesn’t accomplish anything. Things take longer for honest users while botnet abusers don’t even notice that the rented hardware is burning more CPU. Nor does it matter because each request still goes through.

For honest users it's not noticeable in normal conditions. But the DDOSer will DDOS themselves. They might make your service slow down for the users when they attack but not because your server gets swamped just because you choose to increase the difficulty of the challenge while you are attacked. DDOSers will notice because they won't be able to make requests as fast. At least not the ones that are costly for you. It's an enforced client side throtling that affects even bad actors.

Generating challenges is really cheap. Calculating a single SHA256 or sth out of a querystring+salt (or better yet 128bit SipHash). Generation and validation can be done on separate layer/server so requests without valid PoW won't even register on your main system.

Re: Let us serve you, but don't bring us down

#227

Earlier quoted context omitted.

Some zealous systems will infer a very regular request rate as coming from automated services and block them, no matter how gentle the rate.

Is this speculation, or something that has actually been seen?

I can't say how the website I'm scraping would respond if I just went full throttle. But it's also just a matter of courtesy anyway not to make ten thousands requests per second.

Funny story - at work we once had a huge spike in requests from a single IP. We all crowded around, thinking it was some malicious hacker from France. How exciting - we're now interesting enough to warrant a DoS! Turns out another team in the company was just pulling all our data into Algolia to improve search. They were clearly not very courteous!

So on the other end (building APIs) I certainly do pay attention to traffic and have Grafana alerts set up around it.

Re: Let us serve you, but don't bring us down

#228

I have a side project that scrapes thousands and thousands of pages of a single website. So as not to piss them off (and so they don't try to block me), my script will take about 6 hours. Between each page fetch it sleeps for a small, random amount of time. It's been working like that for years.

I recall back when I was less experienced I wrote a scraper for downloading recipes from Taste of Home and let Go firebomb them with as many goroutines as it could handle.

I am sorry, admins! I won't do it next time.

Re: Let us serve you, but don't bring us down

#229

This is a job for HTTP 429!

Or 420 :P

I'm getting a lot of down votes so I suspect people might not be aware of the (unofficial) Enhance Your Calm HTTP status code that Twitter coined

https://en.wikipedia.org/wiki/List_of_HTTP_status_codes

Re: Let us serve you, but don't bring us down

#230
post #34
post #5

I run a system at my employer that occasionally gets scraped by malicious users. It can be used to infer the purchasability of a specific domain, which is a moderately-interesting API endpoint, since that requires talking to domain registries. For a while, nobody cared enough about it to abuse the endpoint. But then we started getting about 40 QPS of traffic. We normally get less than 1. I was keeping an eye on it, b…

Maybe mCaptcha [0] is worth a look. It applies a Proof-of-Work like algorithm (not blockchain-related) which makes it very expensive for scrapers to get data in bulk, but poses least amount of friction to individual users. The project is implemented in Rust and received NGI.eu/NLnet funding. I don't know its state of production-readiness, but Codeberg.org is considering using it (this choice is informed by higher res…

> It applies a Proof-of-Work like algorithm (not blockchain-related)

If you're going to waste my energy to do proof-of-work anyway, I'd rather you use it for something useful (even mining crypto-currency to pay for server costs) rather than let it go to waste.

Post reply on HN