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

I don't care that you're online (or: presence EDUs from strangers) #3490

Closed
sdoconnell opened this issue Jul 6, 2018 · 3 comments
Closed

Comments

@sdoconnell
Copy link

sdoconnell commented Jul 6, 2018

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 second every 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!

@sdoconnell
Copy link
Author

sdoconnell commented Jul 6, 2018

"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.

2018-07-06 13:24:13,067 - synapse.federation.transport.server - 259 - INFO - PUT-11482 - Received txn 1530890485914 from stusta.de. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:24:18,932 - synapse.federation.transport.server - 148 - INFO - PUT-11484 - Request from matrix.knipp.nrw
2018-07-06 13:24:18,935 - synapse.federation.transport.server - 259 - INFO - PUT-11484 - Received txn 1530899947554 from matrix.knipp.nrw. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:24:20,011 - synapse.federation.transport.server - 148 - INFO - PUT-11485 - Request from home.matrix.one-crazy-human.net
2018-07-06 13:24:20,013 - synapse.federation.transport.server - 259 - INFO - PUT-11485 - Received txn 1529704270396 from home.matrix.one-crazy-human.net. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:24:35,914 - synapse.federation.transport.server - 148 - INFO - PUT-11486 - Request from open.mula.foundation
2018-07-06 13:24:35,916 - synapse.federation.transport.server - 259 - INFO - PUT-11486 - Received txn 1526980286274 from open.mula.foundation. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:24:36,970 - synapse.federation.transport.server - 148 - INFO - PUT-11487 - Request from matrix.loboto.net
2018-07-06 13:24:36,975 - synapse.federation.transport.server - 259 - INFO - PUT-11487 - Received txn 1527272359343 from matrix.loboto.net. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:24:39,426 - synapse.federation.transport.server - 148 - INFO - PUT-11489 - Request from wobscale.chat
2018-07-06 13:24:39,428 - synapse.federation.transport.server - 259 - INFO - PUT-11489 - Received txn 1528840007777 from wobscale.chat. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:24:42,889 - synapse.federation.transport.server - 148 - INFO - PUT-11490 - Request from pvagner.tk
2018-07-06 13:24:42,890 - synapse.federation.transport.server - 259 - INFO - PUT-11490 - Received txn 1530637524745 from pvagner.tk. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:24:42,920 - synapse.federation.transport.server - 148 - INFO - PUT-11491 - Request from disroot.org
2018-07-06 13:24:42,922 - synapse.federation.transport.server - 259 - INFO - PUT-11491 - Received txn 1530871906020 from disroot.org. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:24:45,403 - synapse.federation.transport.server - 148 - INFO - PUT-11492 - Request from matrix.legit.solid.moe
2018-07-06 13:24:45,410 - synapse.federation.transport.server - 259 - INFO - PUT-11492 - Received txn 1529468250684 from matrix.legit.solid.moe. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:24:45,946 - synapse.federation.transport.server - 148 - INFO - POST-11493 - Request from openpsychology.net
2018-07-06 13:24:49,213 - synapse.federation.transport.server - 148 - INFO - PUT-11495 - Request from several.one
2018-07-06 13:24:49,216 - synapse.federation.transport.server - 259 - INFO - PUT-11495 - Received txn 1530899218396 from several.one. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:24:49,889 - synapse.federation.transport.server - 148 - INFO - PUT-11496 - Request from diasp.in
2018-07-06 13:24:49,891 - synapse.federation.transport.server - 259 - INFO - PUT-11496 - Received txn 1530689910133 from diasp.in. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:24:58,784 - synapse.federation.transport.server - 148 - INFO - PUT-11497 - Request from spydar007.com
2018-07-06 13:24:58,786 - synapse.federation.transport.server - 259 - INFO - PUT-11497 - Received txn 1524604457884 from spydar007.com. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:25:03,899 - synapse.federation.transport.server - 148 - INFO - PUT-11498 - Request from lpw.gg
2018-07-06 13:25:03,901 - synapse.federation.transport.server - 259 - INFO - PUT-11498 - Received txn 1530728212824 from lpw.gg. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:25:05,513 - synapse.federation.transport.server - 148 - INFO - PUT-11499 - Request from half-shot.uk
2018-07-06 13:25:05,514 - synapse.federation.transport.server - 259 - INFO - PUT-11499 - Received txn 1530889230818 from half-shot.uk. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:25:09,534 - synapse.federation.transport.server - 148 - INFO - PUT-11500 - Request from half-shot.uk
2018-07-06 13:25:09,536 - synapse.federation.transport.server - 259 - INFO - PUT-11500 - Received txn 1530889231521 from half-shot.uk. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:25:12,265 - synapse.federation.transport.server - 148 - INFO - PUT-11501 - Request from half-shot.uk
2018-07-06 13:25:12,267 - synapse.federation.transport.server - 259 - INFO - PUT-11501 - Received txn 1530889231691 from half-shot.uk. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:25:50,568 - synapse.federation.transport.server - 148 - INFO - PUT-11504 - Request from 8bitmunch.org.uk
2018-07-06 13:25:50,570 - synapse.federation.transport.server - 259 - INFO - PUT-11504 - Received txn 1530750684337 from 8bitmunch.org.uk. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:25:54,404 - synapse.federation.transport.server - 148 - INFO - PUT-11505 - Request from half-shot.uk
2018-07-06 13:25:54,406 - synapse.federation.transport.server - 259 - INFO - PUT-11505 - Received txn 1530889232771 from half-shot.uk. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:25:58,577 - synapse.federation.transport.server - 148 - INFO - PUT-11506 - Request from half-shot.uk
2018-07-06 13:25:58,579 - synapse.federation.transport.server - 259 - INFO - PUT-11506 - Received txn 1530889233329 from half-shot.uk. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:26:02,869 - synapse.federation.transport.server - 148 - INFO - PUT-11507 - Request from kek.community
2018-07-06 13:26:02,871 - synapse.federation.transport.server - 259 - INFO - PUT-11507 - Received txn 1530786033776 from kek.community. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:26:06,684 - synapse.federation.transport.server - 148 - INFO - PUT-11508 - Request from half-shot.uk
2018-07-06 13:26:06,685 - synapse.federation.transport.server - 259 - INFO - PUT-11508 - Received txn 1530889233834 from half-shot.uk. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:26:07,454 - synapse.federation.transport.server - 148 - INFO - PUT-11509 - Request from filterfish.org
2018-07-06 13:26:07,455 - synapse.federation.transport.server - 259 - INFO - PUT-11509 - Received txn 1529560953360 from filterfish.org. (PDUs: 0, EDUs: 1, failures: 0)
2018-07-06 13:26:09,306 - synapse.federation.transport.server - 148 - INFO - PUT-11510 - Request from half-shot.uk
2018-07-06 13:26:09,308 - synapse.federation.transport.server - 259 - INFO - PUT-11510 - Received txn 1530889234153 from half-shot.uk. (PDUs: 0, EDUs: 1, failures: 0)

@ara4n
Copy link
Member

ara4n commented Sep 6, 2018

this is probably a dup of #2514

@richvdh
Copy link
Member

richvdh commented May 24, 2019

this is probably a dup of #2514

and/or #3962

@richvdh richvdh closed this as completed May 24, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants