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

Community routes performance issues #722

Open
m0ar opened this issue Dec 17, 2024 · 0 comments
Open

Community routes performance issues #722

m0ar opened this issue Dec 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@m0ar
Copy link
Contributor

m0ar commented Dec 17, 2024

Description

Documenting perf investigation on the IJ radar in this issue.

The IJ community with 635 nodes in the radar cause a massive slowdown and performance choke on desci-server on related community queries. Calling https://nodes-api-dev.desci.com/v1/communities/298/radar takes anywhere between 45-90 seconds to return.

This is the psuedocode for handling the community radar route, doing massive amounts of queries to get the information needed for the response:

- Call communityService.getCommunityRadar:
    - Largeish 4 table join to get node attestations et al
    - Takes between 1 and >2.5s depending on db cache
- async map attestationService.getNodeEngagementSignals over all nodes:
    - aggregate engagement signals for each node with a largeish join query
    - attach the aggregate signals to the node objects
- map resolveLatestNode over all nodes:
    - node discovery query
    - node versions query
    - fetch manifest over IPFS
    - fall back to repo manifest fetch
- sort resulting (node+engagement+manifest) combo by engagements and claim timestamps

Insights:

  • route lacks pagination, and it's not obvious how to add it due to the global sorting requirements on signals
  • need to massively reduce the amount of work mapped over each radar entry
  • need to prevent preemptively resolving manifests for each node
@m0ar m0ar added the bug Something isn't working label Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant