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

Handle large number of measurements #5

Open
Tracked by #47
bajtos opened this issue Sep 5, 2023 · 3 comments
Open
Tracked by #47

Handle large number of measurements #5

bajtos opened this issue Sep 5, 2023 · 3 comments
Labels
postmortem ❤️‍🩹 Corrective actions identified in postmortems

Comments

@bajtos
Copy link
Member

bajtos commented Sep 5, 2023

The current implementation of the evaluation service keeps all measurements in memory. This opens the door for a DoS attack where an attacker can submit a very large number of measurements to trigger an out-of-memory error in our service.

Places we need to fix:

  • When fetching measurements inside a CID, we should reject files that are too large (e.g. more than 1MB).
  • We should process measurements incrementally in a streaming way.
  • We should store measurements on the disk or in a database
  • The evaluation process should not load all measurements into memory at once
@bajtos
Copy link
Member Author

bajtos commented Nov 2, 2023

See also:

@bajtos
Copy link
Member Author

bajtos commented Nov 23, 2023

We should store measurements on the disk or in a database

Let's use sqlite3, it's the tool recommended by Fly.io.

https://fly.io/blog/all-in-on-sqlite-litestream/

@juliangruber
Copy link
Member

Sgtm!

@bajtos bajtos added the postmortem ❤️‍🩹 Corrective actions identified in postmortems label Nov 29, 2023
@juliangruber juliangruber mentioned this issue Dec 5, 2023
8 tasks
@bajtos bajtos moved this from 📥 todo to 🗃 backlog in Space Meridian Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
postmortem ❤️‍🩹 Corrective actions identified in postmortems
Projects
Status: 🗃 backlog
Development

Successfully merging a pull request may close this issue.

2 participants