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

[Dashboard] graph loading speed is too slow #238

Closed
3 tasks
ori-near opened this issue Jan 22, 2025 · 5 comments · Fixed by NEAR-DevHub/ref-sdk-api#6 or #250
Closed
3 tasks

[Dashboard] graph loading speed is too slow #238

ori-near opened this issue Jan 22, 2025 · 5 comments · Fixed by NEAR-DevHub/ref-sdk-api#6 or #250
Assignees
Labels
bug Something isn't working

Comments

@ori-near
Copy link

ori-near commented Jan 22, 2025

Problem

Currently, the graph loading speed is way too slow (e.g. at worst I've observed close to 45 seconds) for the dashboard graph.

Acceptance Criteria

  • Investigate if there's an easy technical solution for solving this (time box this to 1/2 day)
    • If we identify a quick solution (e.g. 1 day), let's implement it
    • If we don't identify a solution, let's make a decision (e.g. do we accept slow loading, do we implement a loading progress bar, or do we hide or move the graph temporarily)
@ori-near ori-near added the bug Something isn't working label Jan 22, 2025
@ori-near ori-near moved this from 🆕 Triage to 📋 Backlog in 🚀 DevHub Products Jan 22, 2025
@ori-near ori-near changed the title Dashboard graph loading speed is too slow [Dashboard] graph loading speed is too slow Jan 23, 2025
@FREZZZBE
Copy link
Collaborator

@petersalomonsen @rubycop @Megha-Dev-19 @Tguntenaar Do you have any ideas?

@rubycop rubycop moved this from 📋 Backlog to 🏗 In progress in 🚀 DevHub Products Jan 23, 2025
@rubycop
Copy link
Collaborator

rubycop commented Jan 23, 2025

Can we try to use our indexer for that? @Tguntenaar is it fast to implement?

@Tguntenaar Tguntenaar self-assigned this Jan 24, 2025
@Tguntenaar
Copy link
Collaborator

Tguntenaar commented Jan 24, 2025

As a temporarily solution I've scaled the fly machine in multiple ways. First we keep the cache warm by always having a machine on. Secondly I scaled from 1 to 2 CPU's and 1gb to 2gb of RAM. I've also add 512mb swap_size_mb for memory spikes. If this doesn't speed it up the chart enough we can persistently cache the https://archival-rpc.mainnet.near.org responses. Not just in memory.

One concern with this implementation is that the archival node will reduce it's rate-limits even further on February 1st. So the fly instance will get rate limited and so we NEED to make a more persistent cache, with Redis or Postgres.
Image

@Tguntenaar
Copy link
Collaborator

@rubycop We could also speed up the chart loading by prefetching the different periods data and not refetching when a user switches between periods. AKA by lifting the API call logic up.

I will start implementing this now.

@Tguntenaar
Copy link
Collaborator

I made 2 PR's, they both significantly upgrade the speed.

NEAR-DevHub/ref-sdk-api#6
and
#250

@Tguntenaar Tguntenaar moved this from 🏗 In progress to 👀 In review in 🚀 DevHub Products Jan 24, 2025
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in 🚀 DevHub Products Jan 24, 2025
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
Status: Done
4 participants