Struct photondb::PageStoreOptions
source · #[non_exhaustive]pub struct PageStoreOptions {Show 14 fields
pub write_buffer_capacity: u32,
pub max_write_buffers: usize,
pub use_direct_io: bool,
pub max_space_amplification_percent: usize,
pub space_used_high: u64,
pub file_base_size: usize,
pub cache_capacity: usize,
pub cache_estimated_entry_charge: usize,
pub cache_file_reader_capacity: u64,
pub prepopulate_cache_on_flush: bool,
pub separate_hot_cold_files: bool,
pub compression_on_flush: Compression,
pub compression_on_cold_compact: Compression,
pub page_checksum_type: ChecksumType,
}
Expand description
Options to configure a page store.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. }
syntax; cannot be matched against without a wildcard ..
; and struct update syntax will not work.write_buffer_capacity: u32
The capacity of the write buffer. It should be power of two.
Default: 128MB
max_write_buffers: usize
The maxmum number of write buffers.
If there exists too many write buffers, writing will be stalled until at leaset one write buffer is flushed.
Default: 8
use_direct_io: bool
If true, use O_DIRECT to read/write page files.
Default: false
max_space_amplification_percent: usize
The max percentage of the space amplification.
The space amplification is defined as the amount (in percentage) of additional storage needed to store a single byte of data in the database.
Default: 100
space_used_high: u64
The high watermark of the used storage space of the database.
Default: u64::MAX
file_base_size: usize
Target file size for compaction.
Default: 64MB
cache_capacity: usize
The capacity of the page read cache in bytes.
Default: 8 Mib
cache_estimated_entry_charge: usize
The estimated average charge
associated with cache entries.
Default: 8 Kib
This is a critical configuration parameter for good performance for page read cache, because having a table size that is fixed at creation time greatly reduces the required synchronization between threads.
- If the estimate is substantially too low (e.g. less than half the true average) then metadata space overhead with be substantially higher (e.g. 200 bytes per entry rather than 100). This can slightly reduce cache hit rates, and slightly reduce access times due to the larger working memory size.
- If the estimate is substantially too high (e.g. 25% higher than the true average) then there might not be sufficient slots in the hash table for both efficient operation and capacity utilization (hit rate). The cache will evict entries to prevent load factors that could dramatically affect lookup times, instead letting the hit rate suffer by not utilizing the full capacity.
cache_file_reader_capacity: u64
The capacity of file_reader cache.
Default: 5000 file_readers.
prepopulate_cache_on_flush: bool
Insert warm pages into PageCache during flush if true.
Default: false
separate_hot_cold_files: bool
Separate page files into hot/cold parts.
This is temproray options for validating.
Default: false
compression_on_flush: Compression
Compression method during flush new file. include hot rewrite.
Default: Snappy.
compression_on_cold_compact: Compression
Compression method during compact cold file.
Default: Zstd(Level3).
page_checksum_type: ChecksumType
ChecksumType for each page.
Default: NONE.