Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

we send presence updates to all the servers that our users share rooms with, whenever a remote user joins any of those rooms #3962

Closed
richvdh opened this issue Sep 26, 2018 · 5 comments
Assignees
Labels
A-Performance Performance, both client-facing and admin-facing z-p2 (Deprecated Label)

Comments

@richvdh
Copy link
Member

richvdh commented Sep 26, 2018

I suspect this is the root cause of #2514 and a bunch of other similar reports like #1429 and #3490.

Whenever a remote user joins a room, we look for any local users that are in that room, and then, for each local user, send out presence updates to all the servers that user shares a room with.

@jevolk
Copy link

jevolk commented Oct 21, 2018

This should be a high priority "p1" or whatever issue. The presence spam is a rather large N*N load on the federation which will return considerable value after investing in its redress. It also has security implications leaking usernames to servers.

Here's an example just looking at Construct's console just this moment:

1540156656.160850     INFO      ircd   client     44 :4ray.co @jean:4ray.co is active and online 15 seconds ago
1540156657.311620     INFO      ircd   client     94 :4ray.co @jean:4ray.co is active and online 17 seconds ago

And there are a plethora of others which are immediately discarded as redundant or stale and don't even show up.

@richvdh
Copy link
Member Author

richvdh commented Feb 1, 2019

this needs fixing pre-v1.0.

@Half-Shot
Copy link
Collaborator

Half-Shot commented Feb 19, 2019

Anecdotally, I'm now seeing outgoing federation transactions at the rate of about 70Hz (almost entirely made up of EDUs) which is causing my server to fall behind sending PDUs, which in turn makes conversations quite difficult to have. If we can't fix the spam, could the federation sender at least prioritise PDUs over EDUs?

@richvdh
Copy link
Member Author

richvdh commented Feb 19, 2019

sure, feel free to write a PR.

frankly it should be easier to fix the bug.

erikjohnston added a commit that referenced this issue Mar 26, 2019
Primarily this fixes a bug in the handling of remote users joining a
room where the server sent out the presence for all local users in the
room to all servers in the room.

We also change to using the state delta stream, rather than the
distributor, as it will make it easier to split processing out of the
master process (as well as being more flexible).

Finally, when sending presence states to newly joined servers we filter
out old presence states to reduce the number sent. Initially we filter
out states that are offline and have a last active more than a week ago,
though this can be changed down the line.

Fixes #3962
erikjohnston added a commit that referenced this issue Mar 27, 2019
Primarily this fixes a bug in the handling of remote users joining a
room where the server sent out the presence for all local users in the
room to all servers in the room.

We also change to using the state delta stream, rather than the
distributor, as it will make it easier to split processing out of the
master process (as well as being more flexible).

Finally, when sending presence states to newly joined servers we filter
out old presence states to reduce the number sent. Initially we filter
out states that are offline and have a last active more than a week ago,
though this can be changed down the line.

Fixes #3962
@erikjohnston
Copy link
Member

Hopefully fixed by #4942

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Performance Performance, both client-facing and admin-facing z-p2 (Deprecated Label)
Projects
None yet
Development

No branches or pull requests

5 participants