this post was submitted on 12 Jun 2023
3 points (100.0% liked)

Lemmy

12531 readers
11 users here now

Everything about Lemmy; bugs, gripes, praises, and advocacy.

For discussion about the lemmy.ml instance, go to !meta@lemmy.ml.

founded 4 years ago
MODERATORS
 

Watching the network tab of Chrome when I have a Lemmy instance open I can watch the websocket data coming in from the server. Even though I have "Subscribed" communities selected, the data stream seems to contain all post data (at first glance it looks like new posts and vote changes) from all communities federated to the instance.

It's manageable for the moment but if the network grows a lot, that could end up being a huge amount of data that's sent to users and probably not desirable if users are on slow metered connections. Is this by design?

top 8 comments
sorted by: hot top controversial new old
[–] Echolot@sh.itjust.works 1 points 1 year ago (1 children)

Lemmys WebSockets are being phased out currently and thus all bugs regarding them (wrong vote counters, posts being pushed in at the top in the wrong categories, etc.) are gonna go away as soon as the transition is complete.

[–] EinfachUnersetzlich@lemm.ee 1 points 1 year ago (2 children)

Oh, cool. What's replacing them?

[–] Echolot@sh.itjust.works 3 points 1 year ago (1 children)

Just a "normal" http API as far as I know. There won't be any live notifications/data on release but this can be added using polling at a later stage. It was mainly done because websockets just don't scale well at all with thousands of users.

[–] EinfachUnersetzlich@lemm.ee 2 points 1 year ago

Yeah, that was my concern. Sounds good to me!

The live posts and notifications are definitely cool but I know it would be challenging to make it both useful and scalable.

[–] andrew@radiation.party 1 points 1 year ago

Normal http requests for on-demand content, likely polling for live-updating content.

[–] marshoepial@lemm.ee 0 points 1 year ago (1 children)

From what I understand the Lemmy backend doesn't support user specific websocket updates. So your client can subscribe to updates about ALL new posts coming in, but it can't get updates on only your subscribed communities.

[–] deadcyclo@lemmy.world 1 points 1 year ago (1 children)

To add to that. It would not surprise me if that is the most efficient way of doing things. Let the client handle all of the filtering. Sure it increases traffic, but it reduces server CPU load greatly.

[–] EinfachUnersetzlich@lemm.ee 1 points 1 year ago

Oh yes, it'll decrease the server load with the sacrifice of network traffic and client load. It's a hard balancing act to get right.