4 ms·
Once you implement a basic ActivityPub server, you realize you're basically asking for a friendly DDoS. If you toot a photo to 1000 followers, your server needs
by turnsout 4y ago
Once you implement a basic ActivityPub server, you realize you're basically asking for a friendly DDoS. If you toot a photo to 1000 followers, your server needs to blast it out to every unique instance in that list of 1000, then ask for whatever updates they have. It's not "efficient," but the upside is that it's conceptually very simple.
- zimpenfish 4y ago> If you toot a photo to 1000 followers, your server needs to blast it out to every unique instance in that list of 1000 I might be misunderstanding here but if you make a status with a photo, it doesn't attach the literal bytes of the photo but the URL to your local copy of the photo which may, admittedly, by fetched 1000 times by those instances if someone on each of those instances looks at it. cf https://octodon.social/@pzmyers/110265584018863694 https://octodon.social/@pzmyers/110265584018863694 which has the link //assets.octodon.social/media_attachments/files/110/265/581/155/000/717/original/0b24824d56920b79.jpeg and also a preview link of https://assets.octodon.social/media_attachments/files/110/265/581/155/000/717/original/0b24824d56920b79.jpeg https://assets.octodon.social/media_attachments/files/110/26....
- turnsout 4y agoUnfortunately, what happens is that (for some reason), instances cache remote media. So if I'm on rando.zyx, it will download and cache the image from octodon.social for local rando.zyx users.
- KomoD 4y agoIt's not just images either, it's the same with link previews, so any link that gets posted will get visited by the instances your instance is federated with, it's even worse when you post a link to a video. Small example log: https://pastebin.com/raw/jYZ1z8dG https://pastebin.com/raw/jYZ1z8dG I've seen some cases where there's been 1000+ requests to a site just because a link to it was posted.
- zimpenfish 4y agoNow that is a problem. But people have suggested workable solutions and hopefully at some point, the Mastodon authors will pull their heads out of their hole and get on with implementing something. I wouldn't hold my breath, mind.
- KomoD 4y agoEarlier today I posted a link to a video on my webserver, all the instances hammered me so hard it maxed out my 1gbps connection
- zimpenfish 4y agoIt's been an issue since 2017[1] (since moved to [2]) but the discussion always devolves into "but what if someone LIES in the federated preview??!!?!" bikeshedding. [1] https://github.com/mastodon/mastodon/issues/4486 https://github.com/mastodon/mastodon/issues/4486 [2] https://github.com/mastodon/mastodon/issues/23662 https://github.com/mastodon/mastodon/issues/23662
- zimpenfish 4y agoWhich is a very different situation to "blast out the photo to 1000 instances". But even then, not all of them fetch and cache media on receipt of a status (e.g. mine don't) and they're not fetching them at the same time according to my logs. You may well still end up serving 1000 copies of the photo (or even more if people aren't caching) but it's 100% not "blast out the photo to 1000 instances when you post" - it's much gentler.
- bee_rider 4y agoIt is a funny that from our point of view, sending out to the internet has one flat cost. Most of my friends (people who would be interested in my photos) live in the same state as me. A bunch live in the same or adjacent towns…