This repository has been archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
I don't care that you're online (or: presence EDUs from strangers) #3490
Comments
"2-3 per second" may have been an exaggeration. Here is a capture from the homeserver.log. Note that this server has been online only a few days, and has only joined rooms on matrix.org. At the time of this capture, one user was logged in on two devices, but was joined to zero rooms.
|
this is probably a dup of #2514 |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Version: 28.1
Installed via 'python2-matrix-synapse' package on openSUSE Leap 15.0
Let me preface this by saying a) I've only recently setup a homeserver, and b) I don't know if this is expected behavior but c) I wouldn't think so.
I have noticed that my homeserver gets a steady flow of m.presence EDUs (2-3
per secondevery few seconds on average) from remote homeservers that I assume were joined to busy rooms that I also joined, but subsequently left. It seems they did not get the 'leave' notification, and continue to let me know that @bob@someserver.tld is offline (or online, whatever). I'm sure Bob's a swell guy, but I don't really care. These EDUs bump the CPU and eat a little bandwidth each time they chat up my server to inform me of Bob's whereabouts. If this trend continues, it seems like that hail of unsolicited presence updates might add up over time, accumulating each time I join and then leave a room. Eventually it might represent a noticeable impact to CPU and network traffic.EDIT: I assumed this presence data was from rooms I had joined, but see also #1429 and #1532. User reported getting status from people they never shared a room with. Maybe same here?
So first question: is this normal, expected behavior for Synapse? Join a busy room, leave, but still continue to get presence updates about some of the people who were in that room? Is this just an unfortunate side effect of decentralization? My (admittedly uninformed) presumption would be that if no users on my homeserver are joined to any rooms, then the only traffic hitting my server should be client connections. I shouldn't see federation traffic if I'm not actively federating. Am I just misinformed on that point?
Further to that point, from a design perspective shouldn't presence requests expire after some period unless renewed? Or perhaps there should be two classes of presence subscription - implicit and explicit. If a user joins a room, that join implicitly requests presence info of the users in the room - but that implicit request expires after some period (perhaps every reconnection to the room performs a renewal?). If a user subscribes to another user's presence, that explicit request might not expire. Either that or leave it to the client to periodically renew presence subscriptions for users in an address book or something (just spitballing). It just seems like there should be a finite life to these things to cover the "didn't get the message" case.
Second question: is there a way to ask Synapse to explicitly send an 'unpoll: @bob@somewhere.tld' message to the sending server to let it know that my server no longer wants to see presence updates for that user (or even better, all users from that server) unless or until the next poll. I have tcpdump running on my homeserver and can see the user IDs being informed about, I could probably let that run for a bit and then parse out the usernames to send to a script that sends 'unpoll' messages. I just don't know if there is some facility in Synapse to do that, or if such a script would have to be created whole cloth (and I'm guessing would have to use the same keys, etc. to authenticate the unpoll request?).
I asked around in #matrix:matrix.org and didn't get any bites, so I thought I would try here to see if someone might have an informed opinion on this case. Thanks!
The text was updated successfully, but these errors were encountered: