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

Inserting data with Durability::None makes database file grow rapidly #810

Closed
tqwewe opened this issue May 16, 2024 · 2 comments · Fixed by #824
Closed

Inserting data with Durability::None makes database file grow rapidly #810

tqwewe opened this issue May 16, 2024 · 2 comments · Fixed by #824

Comments

@tqwewe
Copy link

tqwewe commented May 16, 2024

When inserting data with the Durability::None in a commit, the database file grows extremely large compared to using something like Immediate.

Ideally, I'd like to flush the database every 10 seconds or so, as the data being stored can be recomputed and isn't super important.

Inserting a (&str, Vec<u64>) with 100,000 u64's (being inserted one at a time) results in the file growing to dozens of GB before I need to forcefully stop my app. However doing so with the Durability set to Immediate is just a few MB.

@adamreichold
Copy link
Contributor

Ideally, I'd like to flush the database every 10 seconds or so, as the data being stored can be recomputed and isn't super important.

Note that you can implement this using the public API: Have a thread/task run something like db.begin_write()?.commit()?; every 10 seconds or so to flush the non-durable transactions using a single durable transaction.

@cberner
Copy link
Owner

cberner commented Jul 14, 2024

Yes, this is one of the limitations of redb. Performing a large number of Durability::None commits, sequentially, is not recommended

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

Successfully merging a pull request may close this issue.

3 participants