-
Notifications
You must be signed in to change notification settings - Fork 91
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
feat(spooler): Add file backed envelope stacks #4138
base: master
Are you sure you want to change the base?
Conversation
relay-config/src/config.rs
Outdated
#[default] | ||
Memory, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With this default, our currently deployed configs will revert to Memory
even if they have a path
set.
Bonus points if you can make it an adjacently or untagged enum while maintaining backward compatibility:
Memory,
Sqlite(PathBuf),
FileBacked(PathBuf)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this is a good point. I will try to make it work.
Adds the benchmarking tool introduced in #4138. Example usage: ```shell ./target/release/bench-buffer \ --envelope-size-kib 100 \ --batch-size 1 \ --implementation sqlite \ --mode sequential \ --projects 100000 \ --duration-secs 100 ```
This PR implements a new file backend envelope stack, creating a file per
own_key
project_key
combination. The files have a custom format designed for fast access and the data layout is explained in code comments.The whole idea of this mechanism is that we always append and remove data from the end of the file, meaning no in-memory buffering takes place. When a file is found to be empty, it will be removed from the file system.
In the future, given our file-per-pair model, we could parallelize spools and batch them.