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

Our database is melting down under heavy load #144

Closed
Tracked by #47
bajtos opened this issue Nov 21, 2023 · 3 comments
Closed
Tracked by #47

Our database is melting down under heavy load #144

bajtos opened this issue Nov 21, 2023 · 3 comments
Assignees
Labels
bug 🐛 Something isn't working

Comments

@bajtos
Copy link
Member

bajtos commented Nov 21, 2023

Grafana dashboards are now taking ages to load. Queries executed by spark-api are gradually becoming slower and slower.

  1. Setup monitoring to understand how DB performance changes over time
  2. Identify opportunities for "quick win" performance improvements and apply them

Future improvements:

@bajtos bajtos added the bug 🐛 Something isn't working label Nov 21, 2023
@bajtos bajtos self-assigned this Nov 21, 2023
@bajtos bajtos changed the title Improve database performance Our database is melting down under heavy load Nov 21, 2023
@bajtos bajtos moved this to 🏗 in progress in Space Meridian Nov 21, 2023
@bajtos
Copy link
Member Author

bajtos commented Nov 23, 2023

Todo:

  • finish feat: report per-round retrieval stats to InfluxDB spark-evaluate#67
  • rework all Grafana visualisations to source data from InfluxDB
  • periodically delete old rounds & measurements from our DB - keep data for last 30 days
    DELETE FROM measurements WHERE finished_at < '2023-11-01T00:00:00.000Z';
    DELETE FROM spark_rounds WHERE created_at < '2023-11-01T00:00:00.000Z';

@bajtos
Copy link
Member Author

bajtos commented Nov 28, 2023

periodically delete old rounds & measurements from our DB - keep data for last 30 days

This isn't urgent, I opened a follow-up issue to implement it later:

@bajtos
Copy link
Member Author

bajtos commented Nov 28, 2023

More optimisation opportunities:

  • Create an index to support the query we use to visualise SPARK rounds

    SELECT created_at as time, id as round_number
    FROM spark_rounds
    WHERE "created_at" BETWEEN '2023-11-27T20:12:13.471Z' AND '2023-11-28T08:12:13.471Z'

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
Development

No branches or pull requests

1 participant