Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EW using 100% CPU, looping on /keys/query for dead users on every sync request #27867

Closed
ara4n opened this issue Jul 28, 2024 · 5 comments · Fixed by element-hq/synapse#17499
Closed
Assignees
Labels
A-E2EE A-Performance O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect

Comments

@ara4n
Copy link
Member

ara4n commented Jul 28, 2024

Steps to reproduce

  1. Notice your laptop is draining power faster than usual
  2. Spot Element Desktop Nightly chewing constant 100%+ CPU in top
  3. Profile it
  4. Discover it's WASM crypto using pretty constant 100% CPU
  5. Check console logs, and see it constantly hammering /keys/query for the same set of dead users on every /sync response.

Outcome

What did you expect?

Have a sensible retry schedule calling /keys/query on dead users; don't do it on every /sync request.

Don't use 100% CPU in rust-sdk-crypto when the app is basically idle

Operating system

No response

Application version

Element Nightly version: 2024072801 Crypto version: Rust SDK 0.7.1 (c8c9d15), Vodozemac 0.6.0

How did you install the app?

No response

Homeserver

matrix.org

Will you send logs?

Yes

@ara4n ara4n added the T-Defect label Jul 28, 2024
@ara4n
Copy link
Member Author

ara4n commented Jul 28, 2024

have put perf trace on the rageshake.

@ara4n ara4n changed the title EW using 100% CPU, looping on /keys/query for dead devices on every sync request EW using 100% CPU, looping on /keys/query for dead users on every sync request Jul 28, 2024
@dosubot dosubot bot added O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Severely degrades major functionality or product features, with no satisfactory workaround labels Jul 28, 2024
@richvdh
Copy link
Member

richvdh commented Jul 28, 2024

This seems to be a recent regression. It is most annoying.

@t3chguy
Copy link
Member

t3chguy commented Jul 29, 2024

Sounds related to closed #27165

@richvdh
Copy link
Member

richvdh commented Jul 29, 2024

yes, but I think a somewhat different cause.

@richvdh
Copy link
Member

richvdh commented Jul 29, 2024

I think this is actually a regression in synapse, likely introduced by element-hq/synapse#17273: Synapse is no longer populating the failures property in the response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-E2EE A-Performance O-Frequent Affects or can be seen by most users regularly or impacts most users' first experience S-Major Severely degrades major functionality or product features, with no satisfactory workaround T-Defect
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants