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

store: answer history queries from sqlite DB #950

Closed
2 tasks done
kaiserd opened this issue May 2, 2022 · 3 comments
Closed
2 tasks done

store: answer history queries from sqlite DB #950

kaiserd opened this issue May 2, 2022 · 3 comments
Assignees
Milestone

Comments

@kaiserd
Copy link
Contributor

kaiserd commented May 2, 2022

Background

While nwaku features a sqlite3 database for persisting messages,
history queries are only answered from the in-memory store.
When starting a nwaku node, --store-capacity messages are loaded from the sqlite3 DB into the in-memory database.

We also limited the capacity limit for the persistent storage in #900, to avoid overly long starting times for nwaku nodes.

Goal / Motivation

For some applications, storing more messages is desired. For instance, keeping a history of one month of messages.
To achieve this, a first simple solution is introducing a (large capacity) sqlite3-only store.

A follow up issue will track a feasibility test of the sqlite3-only store.
(Performance might not be sufficient.)

Acceptance Criteria

  • sqlite3-only store implemented
  • tests added

Future Work

  • generic store interface
@jakubgs
Copy link
Contributor

jakubgs commented May 23, 2022

We seriously need this done. Right now it takes ~17 minutes for a node with 684365 messages in the DB to start:

INF 2022-05-23 17:37:46.236+00:00 attempting to load messages from persistent storage topics="wakustore" tid=1 file=waku_store.nim:370
INF 2022-05-23 17:53:53.236+00:00 successfully loaded from store             topics="wakustore" tid=1 file=waku_store.nim:377

And it appears it's fully utilizing the available disk I/O while doing it:

image

And we can see the container memory usage growing as it goes along:

image

@jakubgs
Copy link
Contributor

jakubgs commented May 23, 2022

I see the issue, it's because it's SWAPing due to container memory limits, which bumps the disk usage further:

image

This is not sustainable for any kind of large history.

@kaiserd
Copy link
Contributor Author

kaiserd commented May 24, 2022

Yes! I was busy with other pressing issues that took precedence, but now back on this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants