Skip to main content

StorageOptions

Struct StorageOptions 

Source
pub struct StorageOptions {
    pub max_open_files: i32,
    pub keep_log_file_num: usize,
    pub write_buffer_size_bytes: Option<usize>,
    pub max_write_buffer_number: Option<i32>,
    pub bloom_filter_bits_per_key: Option<i32>,
}
Expand description

Operator-tunable rocksdb options. Defaults match what RocksDbStorageEngine::open applied historically (modest max_open_files, capped LOG retention) — production deployments override via the [storage] config section.

Fields§

§max_open_files: i32

Cap on open SST files. RocksDB’s default of -1 keeps every SST in the table cache forever, which blows past typical FD soft limits in CI / test setups. 64 is plenty for the hot set in the foundational test suites; bump for production read-heavy workloads.

§keep_log_file_num: usize

Maximum number of historical INFO log files to keep on disk. RocksDB’s default is 1000 which produces a long tail of LOG.old.* files that compounds disk pressure when many databases run in parallel.

§write_buffer_size_bytes: Option<usize>

Per-column-family memtable size (write buffer). Bigger = fewer L0 files + more memory per CF. RocksDB’s default is 64MB; tuning below that helps small / many-tenant deployments, above for write-heavy single-tenant ones. None keeps the upstream default.

§max_write_buffer_number: Option<i32>

Maximum number of memtables before writes stall. Bigger = more headroom for write bursts at the cost of memory. RocksDB’s default is 2; 4-8 is common for write-heavy loads. None keeps the upstream default.

§bloom_filter_bits_per_key: Option<i32>

Bloom filter bits per key on the block-based table format. Bigger = lower false-positive rate on point reads at the cost of memory. RocksDB’s default builds no bloom filter unless explicitly configured; 10 bits gives ~1% FP rate and is the typical recommendation. None keeps the upstream default (no bloom filter).

Trait Implementations§

Source§

impl Clone for StorageOptions

Source§

fn clone(&self) -> StorageOptions

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for StorageOptions

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for StorageOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.