Lemmy.nz is now using Anubis for certain requests

8 months ago by Dave to c/support

Earlier in the series:

TL;DR of this post: We now have Anubis on Lemmy.nz, which helps protect against scrapers.

Hi everyone! As some have noticed, the site has been slow these past few days, which was due to a massive amount of traffic presumed to be from AI scraping bots training LLMs. I posted this elsewhere but will put it here again for good measure (7 day history): unique visitors graph showing seven days of graph, no scale but a total of 4.53 million unique visitors, with the last three days being a huge increase

Yeah so that peak of the graph is over 2 million unique requests that day, and the earlier part of the week has about 100k a day. So a 20x increase in traffic.

You may have also seen some weird stuff over this weekend as I played with how to get Anubis inserted into our Lemmy setup, which wasn't too straightforward with our multitude of frontends and our load balanced Lemmy-UI. You might have seen errors, apps might not have been able to load due to being incorrectly blocked, or you might not have been able to load the site at all. Apologies for this, but I think I have it sorted now.

Running under the assumption that the scrapers are not directly targeting Lemmy but are just scraping everything on the net and we just happen to have a significant amount of content, Anubis has been added only to the front ends (websites you see accessing in a browser), and if you are logged in then the policies are set so Anubis should just pass you straight through without any checks.

The APIs and federation and anything else happening directly with the backend do not go through Anubis. This means apps should not be affected and loading images should not be affected.

I've already noticed a big difference in CPU usage. It went from periods of time averaging over 150% (as in, the CPU couldn't keep up, and you'd see Lemmy fail to load at these times), to the last hour peaking at 47% and mostly hovering around 15-25% CPU usage.

Click for image of last 24 hours CPU usage

CPU usage graph of past day showing high CPU usage, then a significant drop over the last few hours

Adding Anubis is a pretty big change that has a decent chance of breaking something so please let me know if you see anything weird!

I'm also happy to give more technical info if anyone wants to know about how it's implemented, the architecture of our Lemmy setup and how it fits in, or anything else. Just ask!

deadbeef79000 4 points 8 months ago

I have occasionally got an Anubis 'you are not a bot' page when using the site normally.

It seems to persist for a few minutes or hours.

path: 0 22333455, hotness: undefined, score: 4, children: 9
Dave 2 points 8 months ago

Hmm. Is that while logged in?

Edit: A screen shot of the page and URL would be a great help!

path: 0 22333455 22333557, hotness: undefined, score: 2, children: 8
deadbeef79000 3 points 8 months ago

Yes.

It actually happened this morning while I was using Lemmy on the bus!

Which was only mildly annoying as I was only a few minutes from hopping off.

path: 0 22333455 22333557 22333637, hotness: undefined, score: 3, children: 7
Dave 2 points 8 months ago

Sorry, just edited my other post to say: Edit: A screen shot of the page and URL would be a great help!

I am wondering if this is actually related to the Lemmy-UI not responding, and inserting Anubis in the middle may have meant the load balancer isn't working if Anubis is returning a success message.

path: 0 22333455 22333557 22333637 22333659, hotness: undefined, score: 2, children: 6
deadbeef79000 2 points 8 months ago

I'll grab one next time!

path: 0 22333455 22333557 22333637 22333659 22333672, hotness: undefined, score: 2, children: 5
Dave 3 points 8 months ago

5 hours later, here's an updated graph:

this image actually contains two graphs. They don't have numbers or scales on them. The top graph The top one is called CPU Usage and shows very spikey up and down lines reaching all the way to the top of the graph, for a little over half of the graph heading from left to right. The lines then fall to not reaching higher than about 1/6th of the height of the graph, showing a significant fall. This continues from just after half way all the way to the end, i.e. now. The second graph is labelled disk io, with a key showing purple for reads and blue for writes. The blue stays down at the bottom with any spikes not really visible at this scale. The purple (reads) shows frequent spikes all the way to the top of the graph, then a bit after halfway, the same time as the first graph, the read IO appears to almost cease, with some occasional spikes, but it's really just a tiny wiggly line compared to the first half of the graph

path: 0 22279203, hotness: undefined, score: 3, children: 0
taldennz 2 points 8 months ago

Yeah. I can't seem to get to http://lemmy.nz/ from my fibre in normal or private tabs on Firefox or chrome, desktop or mobile.

Mobile data works... And if I connect first with mobile in Firefox (non private) and then again on fibre it works (fingerprinting or some other state perhaps).

But for now, on desktop I seem to be blocked.

path: 0 22335534, hotness: undefined, score: 2, children: 9
Dave 1 point 8 months ago

Hmm do you see the Anubis bot checking page or does it not load at all?

If you visit another site with Anubis, say slrpnk.net, does it load ok?

path: 0 22335534 22335635, hotness: undefined, score: 1, children: 8
taldennz 2 points 8 months ago

That one works. I see a similar screen for a bit and then it loads the posts (and I've never been there before)

For Lemmy.NZ I don't see anything except the You are not a Bot. Ironic given my profile

path: 0 22335534 22335635 22335741, hotness: undefined, score: 2, children: 7
Dave 1 point 8 months ago

Oh are you seeing the "You are not a bot" screen but it doesn't continue from there, like others have mentioned?

Are you able to get a screen shot for me, including the URL?

path: 0 22335534 22335635 22335741 22335773, hotness: undefined, score: 1, children: 6
taldennz 2 points 8 months ago

The url is just the url above.

path: 0 22335534 22335635 22335741 22335773 22335892, hotness: undefined, score: 2, children: 5
support
support

@lemmy.nz

login for more options
396
113
19

You can ask questions about the Lemmy.nz instance here.

This community also serves as our Meta community, with posts about updates to the Lemmy software on Lemmy.nz or other things relevant to Lemmy.nz users and not relevant to other instances.

go to feed...