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

Millions of /query/profile requests #12921

Open
richvdh opened this issue May 30, 2022 · 4 comments
Open

Millions of /query/profile requests #12921

richvdh opened this issue May 30, 2022 · 4 comments
Labels
A-Federation A-Performance Performance, both client-facing and admin-facing O-Occasional Affects or can be seen by some users regularly or most users rarely S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.

Comments

@richvdh
Copy link
Member

richvdh commented May 30, 2022

Over the last hour (in which I did rejoin #element:matrix.org, but still), matrix.org has sent my server 1892 GET /_matrix/federation/v1/query/profile?user_id=%40richvdh%3Asw1v.org requests.

They aren't an inherent problem, since they can be served pretty quickly, but this still smacks of huge inefficiency somewhere.

@erikjohnston erikjohnston added the T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. label May 31, 2022
@MadLittleMods MadLittleMods added A-Performance Performance, both client-facing and admin-facing A-Federation A-Federated-Join joins over federation generally suck labels Jun 3, 2022
@clokep
Copy link
Member

clokep commented Jun 7, 2022

Tangentially related, but #12966 removed the "remote profile cache", which was only used for groups (the callers were removed in #12558). I wonder if something similar has other uses.

@DMRobertson
Copy link
Contributor

(That's a surprise. I could've sworn the remote profile cache was somehow related to the user directory. Apparently not.)

@turt2live
Copy link
Member

I posted a message to HQ (2 if you count edits) and so far I'm at over 1500 requests all of a sudden.

# cat federation_reader_1.log | grep "matrix.org.*query/profile" | wc -l
1650

This sounds like it's related to matrix.org trying to send out push/email notifications or something, failing to cache the sender between notifications.

Currently this is an annoyance on the receiver side, though surely on the matrix.org/remote side it'd be burning a small hole in a bandwidth budget somewhere?

@DMRobertson DMRobertson added T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. A-Performance S-Tolerable Minor significance, cosmetic issues, low or no impact to users. O-Occasional Affects or can be seen by some users regularly or most users rarely T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. A-Performance Performance, both client-facing and admin-facing and removed A-Performance Performance, both client-facing and admin-facing T-Task Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. A-Performance labels Aug 25, 2022
@richvdh richvdh added T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues. and removed A-Federated-Join joins over federation generally suck T-Enhancement New features, changes in functionality, improvements in performance, or user-facing enhancements. labels Aug 25, 2022
@richvdh
Copy link
Member Author

richvdh commented Aug 26, 2022

This sounds like it's related to matrix.org trying to send out push/email notifications or something, failing to cache the sender between notifications.

no, it's from matrix.org users on Element Android making GET /_matrix/client/r0/profile/<userid> requests, each of which triggers two GET /_matrix/federation/v1/query/profile requests, because (a) there is no caching whatsoever (b) displayname and avatar are fetched separately.

Some sort of caching seems like it would be helpful.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A-Federation A-Performance Performance, both client-facing and admin-facing O-Occasional Affects or can be seen by some users regularly or most users rarely S-Tolerable Minor significance, cosmetic issues, low or no impact to users. T-Defect Bugs, crashes, hangs, security vulnerabilities, or other reported issues.
Projects
None yet
Development

No branches or pull requests

6 participants