Top
Best
New

Posted by petercooper 15 hours ago

A year of fighting scrapers on my 1.5 million-page website(patronview.com)
401 points | 367 commentspage 2
itake 1 hour ago|
I live in Vietnam and was annoyed I can't access the website. You still allow Mullvad VPN users though
Bender 14 hours ago||
Seems about right. I rotated my logs this morning. Most humans go to access.log and most bots go to botpoop.log. This is the line count:

     2 access.log [1]
    40 botpoop.log [2]
2 is really 1 since a human will grab the CSS file. Most bots do not bother with the style-sheet so that's a 40:1 bots to humans. I could cut that down by blocking data-centers but then I inadvertently block a lot of VPN's which I really don't need to do for a static compressed blog served from ram. The bots just get a TCP Reset but it's still fun to log and study them. The most interesting one I've seen recently is ReadYou which may be a reader but it appears to be much more, possibly acting as a cell phone distributed bot collecting data for a centralized site.

[1] - https://nochan.net/logs/access.log

[2] - https://nochan.net/logs/botpoop.log

spockz 14 hours ago||
Is there some existing mechanism already that counts how often an ip only scrapes the page and not the css and then block those origin IPs if it occurs “too often”?

Unfortunately, the best practice is to make css cacheable so you need to keep long histories.

Bender 14 hours ago||
I thought about that but to your point CSS is cachable. In fact I made mine immutable. No I just visually spot patterns and use that to study other facets of the agent, other client headers or lack thereof, supported protocol, accepted encoding and so on.
spockz 13 hours ago||
Maybe it is enough to include some css/js which is served without cache and is loaded after all user visible css/js is loaded. Make it small enough to not cause too much bandwidth for the server and legitimate clients. Then anyone who doesn’t hit that CSS file gets banned.
Bender 12 hours ago||
Possibly. I've noticed however that if people default to reader view they don't always pull the CSS. Seems to vary by client software. I'm weird enough to just stick with visual inspection and add characteristics when botters get too clever. Playing with the botters is almost as fun as Megabonk.
Bender 4 hours ago||
More realistic numbers now that HN and others have been visiting all day. Line count:

    104 access.log
    366 botpoop.log
Unique IP's:

     54 access.log
    181 botpoop.log
storus 14 hours ago||
Is there any cheap way to run personal websites without getting cooked by bots these days, degrading the performance? A $5/month VPS won't cut it anymore.
jerf 14 hours ago||
"A $5/month VPS won't cut it anymore."

Are you speaking from experience, or inferring from articles like this?

I serve a static site on the lowest Linode $5/month VPS and it is grotesquely overprovisioned for that use case. It is not the case that every site is getting slammed every second by hundreds of requests per second.

Now, if you have some sort of dynamically-computed website that is generated by a slow scripting language that is poorly optimized and hits the database too many times for a single page, yeah, it doesn't take many RPS to take you out. But that isn't the only option; it's the slowest of the slow options. Realistic, there are plenty of sites that match that description, but I concatenated that many clauses on purpose. Drop any one of them and your personal site will be fine.

marginalia_nu 14 hours ago||
It's almost always the DBMS that's the bottleneck when websites drop from traffic. As long as you don't do anything fancier than primary key look-ups you're probably fine though.

I survived handling the search search traffic generated by this thread[1] on PC hardware off a residential broadband connection without any sort of degradation. Only time I've gone offline from traffic was when Elon Musk tweeted a link to one of my blog posts, and that was just a short temporary blip.

[1] https://news.ycombinator.com/item?id=28550764

allthetime 14 hours ago|||
For a “personal website” or any relatively simple static content site, the DB should not be getting hit much at all. Cache is your friend. For my sites I have a map of all relevant queries and when we do updates we run the relevant queries one time and cache them to both memory and file system.
marginalia_nu 13 hours ago||
Should being the operative word. In practice it's both easy and common to have a database do unnecessary work when generating a page, a problem that often only rears its head when under unusual load.
jerf 14 hours ago|||
Yeah, IIRC my django site was 3 queries, all correctly indexed, for a main page hit, and 2 for the actual posts. I don't recall the exact perf numbers, but I'm pretty sure it was easily in the 50/rps range for a small dual-CPU host... which doesn't sound like much in "requests per second" but is enough to cover a front-page-HN'ing just fine. And that "rps" was just the database-backed pages, all the static content was served over nginx, so that 50rps is a "real", 50 humans per second rps, not something getting consumed by only two or three humans.
marginalia_nu 14 hours ago|||
Static files on literally any hardware from the last 15 years on modern server software simply won't get cooked by bots. The network switch will bottleneck you before the server will. Your ephemeral port range will run out before the server will.
throwaway219450 14 hours ago||
Bandwidth is still not free, if you cloud host.

I had a client ask me to look into why their bill spiked 5x (admittedly not by much - from a few dollars to tens). They run a static site, and it turned out someone had inadvertently replaced an image with a massive uncompressed photo. Every unique visitor was caching O(25MB) when they loaded the homepage. Also funny because now everyone has 100Mb+ internet, nobody noticed a few extra seconds on load.

There are lots of solutions to this if you actually need to serve a lot of bytes, but you can get stung even with very simple deployments. Not everyone wants to put Anubis or Cloudflare in front of their site.

kube-system 13 hours ago||
Only at the top few cloud providers. Search "Unmetered VPS" and you can find $5 VPSes with no bandwidth bill
speak_plainly 14 hours ago|||
Cloudflare offers a free plan that's fantastic. The free plan gives you effectively unlimited DNS/CDN traffic for a normal site, while the main practical cap is 100,000 Worker invocations per day, with 10 ms CPU per Worker request and a 100 MB request body limit. (If that means anything to you).

The next tier up from free is $25/month or $240 per year.

https://www.cloudflare.com/plans/ https://www.cloudflare.com/plans/free/

matsemann 13 hours ago|||
I use this. Buy a domain, set up a cloud flare pages that builds an Astro page on git push, served statically for free.
everybodyknows 12 hours ago|||
Does the free tier support geo-blocks? I'm experimenting with it -- running only a "hello, world" site thus far -- but haven't come across any offer of geo-block capability.
npilk 13 hours ago|||
GitHub Pages, GitLab Pages, and Cloudflare Pages are all free. If you have a static site, you don't need to worry about lock-in, since your files are easily portable to a different provider.

I made this tool to try and make it easier for beginners to get something up on the public web for free: https://weejur.com

Athas 14 hours ago|||
I run my personal website (and a bunch of other websites and services) off a somewhat more expensive but still reasonable VPS (I think 20€ at TransIP - it's so little that I forgot). Load is basically nil most of the time anyway. I think the bot problem is not so bad for personal websites.
inigyou 14 hours ago|||
Yeah, you just make sure your site is fast enough to handle more than 1 RPS.

But if you want them to actually stop, you can also just serve a little JavaScript page that sets a cookie and refreshes, to anyone who hasn't set the cookie. The DDOS attacker doesn't run JavaScript.

__turbobrew__ 5 hours ago|||
I host a static site on S3 with cloudfront on top and my bill is usually a few dollars. It was $2.88 last month. The site could also probably handle many orders of magnitude more traffic than it currently does because cloudfront scales to that level without work needed on my side.
coldpie 13 hours ago|||
I host a couple WordPress blogs on Lithium Hosting. It's like $5/mo, fixed cost, and I've never had any issues. If I somehow hit a transfer usage cap, they would just shut my site down until the next month, but I've never had that happen.
somehnguy 14 hours ago|||
A $5/month VPS should cut it completely fine unless you're doing something very complicated.
hk__2 13 hours ago|||
All my personal websites are on a single $5/mo OVH VPS and it works perfectly fine.
cdrnsf 13 hours ago|||
My site's built in Go on a reasonably priced VPS and holds up well. I do geoblock traffic from China and a few other countries as well as IP ranges maintained by Spamhaus.
strenholme 14 hours ago|||
I have a low cost VPS (actually two in two different pre-AI datacenters) and it runs fine. I use nginx to serve the web pages, and the content is about 99% static content.

The vBulletin and PHPbb style forums have issues with slowdown (I haven’t had a forum since 2015; even back then those forums were overrun with spambots), but static content on a nginx site can be served lightning fast.

kube-system 14 hours ago|||
If you have a static site, GitHub pages is free
strenholme 14 hours ago||
As someone who is moving my static sites over to GitHub pages: While they are free and work really nice, the problem is that GitHub frequently doesn’t deploy updates to the pages.

I have frequently have had to update a GitHub page, push the change, and then GitHub’s actions puke instead of deploying the change. The workaround is that I have a .txt file with a list of GitHub actions which failed, and when GitHub actions fails, I update that .txt file and push the updated site, which GitHub actions will hopefully successfully deploy.

GitHub pages are OK for pages which aren’t updated very frequently, but they are not OK for pages which update frequently.

bigbuppo 13 hours ago|||
Static site. If you do go for a WCM of some sort you should make sure that if it has a calendar view of some sort it isn't unbounded but that it only goes as far back as your first post, and only goes as far forward as your latest. That's one of the many ways the poorly-implemented AI systems get stuck.
allthetime 14 hours ago|||
A $5/month VPS is fine for mostly static content. I’ve got a site that has been pulling millions of viewers and sits at the top of google for its niche for a decade. It is now hammered with bot traffic constantly. But everything is cached so it’s fine.
rglover 14 hours ago|||
All of my boxes are cheap VPS. Highly recommend people throw Cloudflare in front of their stuff. I switched all of my load balancers over to there and all of that bot crap went away. That combined with a proper UFW setup keeps the weather clear for me.
inigyou 14 hours ago||
Highly do not recommend centralising the internet.
esseph 13 hours ago||
Build a better service or better technology.

If you can't, well then... We're stuck.

inigyou 13 hours ago||
Until proven otherwise in your specific case, the better technology is just hosting directly on a VPS without Cloudflare. And if your 5$ VPS is maxed out, while serving any less than 10 requests per second, then you need to optimize your software before considering an upgrade.
esseph 12 hours ago||
Okay but the bots are loose and you have a bandwidth cap on most VPSs.

Because you have no CDN, all the bots are coming directly to you.

Because that's no CDN or distributed WAF, they're hammering your box.

Because your IP is directly exposed, you're also showing up on Shodan.

Your server may have enough CPU and RAM to handle the load, but does your monthly bandwidth allocation with your provider?

Many are finding previous bandwidth limits (starting around 10TB/month) are no longer enough.

inigyou 10 hours ago||
Bandwidth is cheap at places that don't call themselves "cloud". You can even get unmetered. 10TB/month is usually enough, even with bots. If you're serving large files, put a simple bot test on the page before the files.
esseph 9 hours ago||
> 10TB/month is usually enough, even with bots.

My single static webpage with no updates in 3 years is doing that, which is (one of the reasons) how I end up where that site (and many others in business and personally) is.

You're chasing a dream for a world that doesn't exist anymore.

inigyou 4 hours ago||
no sorry I don't actually believe your single static webpage is doing 10TB/month. That's about 500 RPS average.
ashton314 14 hours ago|||
I'm on a $4/mo droplet on Digital Ocean and my static site has been just fine. I'm using Caddy and it seems to handle the load like a champ. My site is very lightweight though, so ymmv.
ashu1461 14 hours ago|||
Cloudfare has a very generous plan usually for hobby projects. The article did mention that cloudfare did not work for them, but they have recently introduced few features to block AI crawling as well.
HaloZero 12 hours ago|||
I have a very low traffic blog and I just use the nearlyfreespeech to host it. So far it’s been less than $1
archerx 14 hours ago|||
A lot of my sites are on $5 vps and run very well.
yoursred 14 hours ago|||
Sef-host with tailscale or something similar
dmux 13 hours ago||
Exactly. I've been hosting a site from a spare M1 Macbook Pro with Ngrok. An equivalent bare metal server would be much more expensive.
esseph 13 hours ago|||
My sites run on cloudflare workers and static pages for free
stefantalpalaru 14 hours ago||
[dead]
joshspankit 4 hours ago||
How long until Cloudflare is the data broker for websites like this?

“For a low $/GB, we’ll give you everything from this site and 1000 others as (structured data/a database)!”

(yes there are lots of good counter arguments to this, but before you reply think ahead a couple extra steps)

tananaev 13 hours ago||
I also see quite a bit of traffic from China and Singapore. I wonder if it's some scraping for AI training. It doesn't really bother me too much because traffic is still fairly low, but it skews all the analytics for me.
rsolva 9 hours ago||
I made a small booking site for a local dutch canal boat, which has a calender function. A simple PHP app. I checked the Apache logs recently, and it had THOUSANDS of claudebot and other AI UserAgents flooding the logs every day, apparently because the scrapers keep hitting the 'next month' button on the calendar in a an infinite loop, all day, everyday!

This is a small booking app without any useful information at all, it surprises me that the AI boots have no discernment about what the are scraping, just wasting their own and other peoples resources. And their own reputation! You would thing they could spare a few tokens on a classifier model to do a quick evaluation of their scraping efforts, but apparently they do not.

Anyway, I have done my best to block these UAs and so far it seems to have improved the situation.

falcor84 13 hours ago||
It's a sequence of thin lines, between using Chrome out of the box, to using something like Brave, to using a highly customized Zen Browser, to having ChatGPT look up a particular page for you, to using a small BeautifulSoup/scrapy script to scrape dozens of pages, to scraping the entire web. And at every point on this spectrum it's humans driving a "user agent" tool to make requests and process responses on their behalf.
thorsson12 13 hours ago||
The experience of browsing the web has really suffered lately. The mandatory 3-4 second "verifying that you're a human" block from Cloudflare seem to show up on more and more websites. Seems like a questionable choice from Cloudflare to teach everyone to associate Cloudflare's logo with high latency...
duskdozer 12 hours ago|
A 3-4 second cloudflare wait seems good to me at this point. I had to just block any cloudflare requests because some pages that used it would just rev up a cpu core indefinitely and hang the browser.
ashu1461 14 hours ago||
I wonder if the author tried out the recently released feature by cloudfare to block ai bots

https://developers.cloudflare.com/bots/additional-configurat...

smolder 14 hours ago|
Some people don't want to use cloudflare on principle. Like that putting the whole internet behind cloudflare or AWS is a bad thing, in principle.
dzonga 14 hours ago|
blocking by geo yeah might work - but what happens when someone is traveling abroad ? they've to use a VPN to access your site ?

my take with all the bots - the web is gonna be a bunch of private walled gardens. with most sites set to no index. you will only discover them via referral from someone real.

yoursred 14 hours ago|
What happens when someone is from a shit country?
mcraiha 14 hours ago|||
AFAIK you already have to use VPN if you are e.g. westerner visiting China or Belarus.
dzonga 12 hours ago|||
good question ? I worry about that too since I'm from a poor/shit country that I travel to constantly & live for half the time !!
More comments...