Conversation

actually why don’t fedi servers/media proxies use bittorrent to fetch media from each other instead of hammering the origin server? this seems like a low-hanging fruit that can help immensely with load balancing

5
2
6
@mia or ipfs
2
0
0
@mia BitTorrent has way too much latency for those.

Reminds me that there's been datashards as an attempt but it didn't catch on.
https://github.com/WebOfTrustInfo/rwot9-prague/blob/master/topics-and-advance-readings/datashards-rationale.md
2
0
1

@lanodan no it doesn’t. have you seen webtorrent?

you don’t need to rely on dht either. the origin can be a tracker and speed up connection setup that way.

2
0
1

@bartholin ipfs is high-latency, not meant for ephemeral media, and does nothing to mitigate congestion. bittorrent is a better fit.

0
0
3
@mia Ah, I take that one as a somewhat different protocol plus most implementations of it that I've seen also rely on a web-seed.
0
0
0

@lanodan i mean, servers could also speak webtorrent to each other and negotiate the connections via webrtc, but i feel like that’s gonna be a pain for software not written in node.js

0
0
1
@bartholin @mia ipfs is horrible for anything large
0
0
1
@lanodan @mia theee's even clients that let you stream videos as you torrent them
0
0
0
@mia@shrimptest.0x0.st This is what a CDN is for the massive problem i see with this is that if you want to do this client side too it would expose everyones IP

If you want to do it for servers you would need a tracker and setup that stuff for each file.

I would highly reccomend looking into S3 with Ceph and distributing your storage via that, most fedi soft support s3(misskey does)

Torrents are great for sharing big data but i would not reccomend it for single files, the down side of bittorrent is that for as far as i know cannot add files or modify them easily after you make the torrent, you can do this with ceph and s3, also ceph is waaaaaaay more powerfull for storage than bittorrent
1
0
0

@xaetacore some CDNs literally use webrtc to allow clients to share files, and peertube uses it for live streaming fragments as well. there is no technical reason not to do this.

also, modifying files on fedi is not really a thing. they always get a new URI.

1
0
0

@xaetacore webrtc, as well as http/3, were both designed to reduce the need for, and the load on, CDNs. fedi is decentralized, but i see no reason why parts of it can’t be distributed as well.

in fact i think the CDN architecture you’re suggesting is a terrible idea.

notes and media on fedi are ephemeral. storage like this is a concern only for caching and things like misskey’s drive feature. so it’s the fetch, not the storage, that needs to be prioritized.

servers could also use webtorrent (i.e. set up the data channels via webrtc instead of also being torrent trackers).

2
0
0
@mia@shrimptest.0x0.st I still dont think its a good idea from a security perspective, you want to use webtorrent/bitorrent to download to clients that would expose their IP to the entire network behind that
1
0
1

@xaetacore this isn’t about clients. that would not be a low-hanging fruit because it needs work on backends, frontend, apps…

i’m talking about the backend side of things. instances already talk to each other, they already have established peer connections, so why wouldn’t they distribute media like this?

1
0
1

@xaetacore also, building on top of that, if the nodes with complete copies are known, the load could be distributed by allowing clients to fetch from these alternate locations if they are in closer geographical proximity. that might be less trivial in practice though, because you would need end-to-end cryptographic verification of file contents for trust reasons, and preferably without stalling presentation until all the data is available

1
0
1

@xaetacore and for the record, i don’t share your worries about exposing IP addresses. it’s the fucking internet, and it’s not the 90s where you’d bitchslap.exe someone on IRC, nor does that address disclose who you are. if you’re not using tor there is no way in hell this is a real concern to you, and if you are using tor it’s a non-issue to begin with.

1
0
1

@icedquinn it solves a very different problem poorly (distributed storage, not distributed network load)

0
0
0
@mia @xaetacore that might work better in batches. I don't imagine the overhead of torrents is friendly to having one torrent per jpeg.

I've seen webrtc peering but the servers that actually implement the routing tend to be proprietary since it's valuable to sportsball services to get out of paying for bandwidth.

something like using negentropy over casync is also a thing but would still require peering coordination

unless you can finagle a way to let torrent definitions be self updating since fedi servers accumulste media in real time
1
0
1

@icedquinn @xaetacore i’ve used webtorrent as an example because that is used by peertube for live streaming fragments. people have used it for small files on static websites too. it’s really not that slow at all, and it has better congestion management than anything TCP-based.

it’d be optional anyway. like, don’t bother if the roundtrips and stuff to establish data connections would take longer than just serving the file over http under current network conditions.

1
0
0
@mia for the same reason 0x0.st needs a terms of service, caching media is already risky as is, peering it even more so

we can't even get people to peer their public activities anyway
1
0
1

@i i think you misunderstand. this is about more efficiently fetching content that you were already going to fetch anyway, not storage/caching. just network load balancing.

2
0
0

@i so like, if you fully federate with an instance and don’t have their media marked as risky, your instance could also distribute the files that it already downloads. whether it keeps serving them after the fact or stops once the immediate demand subsides is a separate question.

0
0
0
@mia@shrimptest.0x0.st We have some very privacy centric users especially for our i2p and tor frontend it is very important users IP's are not leaked to other clients on the networks, for servers its required that is basic knowledge, My concern was based on my confusion between if you meant client or server side.

In the case of server side as aforementioned thats basic connectivity.
On client side the only thing they should see is the server, they should not connect to other clients using that server unless people are explicitly informed off this.
1
0
0
@mia@shrimptest.0x0.st Another reason why this is important is because it can tie someone to a service and if that can be seen by anyone and everyone not just the server operators then it would become really easy to track people for anyone with an connection to your server
1
0
0

@xaetacore at least some of this can be addressed by restricting connections to other peers based on user preferences (there can be some granularity there, like only connecting to people on the same instance).

though i don’t think client-side stuff like this will make a difference unless your instance is already too big to manage. the real problem is posting a video and getting your instance DDoS’d by a million mastodon instances trying to grab and cache everything they see

0
0
0
@mia you're absolutely right, i just don't understand, how the hell is just taking multiple hops across servers imply better latency or bandwidth efficiency, if none of the servers in the middle bother ever storing it in any way

if it's not a p2p cdn, is it cjdns? overlay network would solve a heck of a lot of issues, but not serving media

also revolver never ever, i don't trust the network to budge at all when it comes to improving peering in any way that's not friend to friend
1
0
0

@i distributing the load does matter. and until http/3 rolls out everywhere, torrents actually have much better latency and behavior in congested networks (which is a big deal to anyone hosting an instance from home)

1
0
0

@i i mean, there is a time window shortly after publishing a note with a file attachment during which demand for that attachment spikes. that’s the main target of this optimization, so there’s a good chance there will be enough active peers for torrents to make a real difference.

1
0
0
@mia sure, in theory, in practice i'm not sure any of the big three would merge it, and too many would overwhelm too few, and that that point an uploader to any other anycast cdn is simpler
0
0
0
@mia @xaetacore https://webtorrent.io/intro i'm on their site but its not saying terribly much about the process.

other than its been used to stream video but like. doesn't say a lot about how the coordination layer is implemented or how to push data with it.

are you meant to shove a new .torrent for every fragment? blobcathuh
1
0
0

@icedquinn @xaetacore it uses webrtc to establish peer connections. it’s not the bittorrent you’re familiar with.

0
0
0