matrix-org / synapse

Synapse: Matrix homeserver written in Python/Twisted.
https://matrix-org.github.io/synapse
Apache License 2.0
11.83k stars 2.12k forks source link

Option to only share presence with members of rooms with `m.direct` #11977

Open svenpaulsen opened 2 years ago

svenpaulsen commented 2 years ago

As you know, presence updates have a major impact on the overall server performance... but just turning it off is not a real solution in most use-cases. Therefore, I'm suggesting a new option in the presence configuration called limit_to_direct_rooms (or something like that).

The idea is, that when collecting the list of interested parties for presence updates, only room ids with a m.direct membership should be used. As a result, users would retrieve presence updates for their "contacts", but not for everyone who's sharing a group chat room. This could help decreasing the server load and increase privacy at the same time.

What do you think? Could this be a reasonable solution?

3nprob commented 2 years ago

This is a great proposal. Would even argue that it'd be a sane future default for privacy reasons.

Related: #8055 #10423

svenpaulsen commented 1 year ago

Any feedback on this? Presence is still a major performance/privacy issue, but disabling it completely is not an option for us. Haven't looked at Dendrite yet. Would that be worth a try?

svenpaulsen commented 1 year ago

We've initiated the implementation of this feature in our system and preliminary testing suggests a substantial reduction in both database usage and CPU load. You can track our ongoing efforts at the following link:

https://github.com/teamspeak/synapse

Our upcoming work will focus on introducing a user-configurable option for this feature. Upon completion, we will share these improvements by submitting a pull request.