pub struct Config {
pub silent: bool,
pub snapshot_interval: u64,
pub memory_bucket_count: usize,
pub sync_mode: SyncMode,
pub target_io_parallelism_snapshots: u64,
pub target_io_parallelism_writelog: u64,
pub target_snapshot_shard_size_bytes: usize,
pub use_positioned_writes: bool,
}
Fields§
§silent: bool
If true, we will not write any snapshot / restore events to stdout. By default this is on as such events are rare and will be helpful to spot unexpected config or runtime issues.
snapshot_interval: u64
The interval at which full snapshots should be created. The unit counted is the
number of key-value pairs modified (created, updated or deleted) meaning if
snapshot_interval
is 10,000, then a snapshot will be created every 10,000
key-value pairs modified.
Notes:
- Snapshots may be skipped if we cannot keep up with the number of changes.
- Snapshots are created asynchronously and do not block reads or writes to the main store (except for a brief lock to create a memory data copy).
- Snapshots are not required for the store to have basic persistence guarantees as all modifications are written to a write-ahead log first. However, regular snapshotting compacts the write-ahead log and helps keep disk usage and startup time to be bounded by O(number of keys) rather than O(number of modifications)
memory_bucket_count: usize
The number of buckets to use for the memory store, each responsible for a part of the keyspace. This is a trade-off between memory overhead and contention avoidance in multithreaded operation. Each bucket has its own dictionary, supporting data structure and mutex.
sync_mode: SyncMode
File system synchronization model.
target_io_parallelism_snapshots: u64
The number of threads to use for IO operations. This includes reading and writing of snapshots and influences (but not fully determines) number of shards used.
target_io_parallelism_writelog: u64
The number of shards to use for the write log (this is directly the file count used)
target_snapshot_shard_size_bytes: usize
The targeted size for a snapshot shard. This is not a hard limit. This number influences (but not fully determines) number of shards used for snapshots.
use_positioned_writes: bool
Whether to make use of positioned writes e.g. write_at() instead of seek() + write(). This uses OS specific extensions and enables higher effective concurrency for writes.