mirror of
https://github.com/rustfs/rustfs.git
synced 2026-08-24 13:16:28 +00:00
feat(disk): isolate fsync blocking pool from main runtime
Add a dedicated tokio blocking runtime for fsync/fdatasync operations, controlled by RUSTFS_RUNTIME_FSYNC_BLOCKING_THREADS (default 0 = off). When configured with >1 threads, fsync operations are dispatched to a separate blocking pool so device-bound fsync does not starve read operations (pread/stat/open) on the main blocking pool. Changed call sites: - run_file_sync_blocking (batch fdatasync) - fsync_dir (directory fsync) - fsync_open_dst_dir_group (dst dir group fsync) - run_blocking_namespace_file_sync_operation_with_global (namespace+fsync) Unchanged (stay on main pool): - run_blocking_namespace_operation (rename/metadata) - local.rs spawn_blocking calls (pread/stat/open) Default behavior is unchanged (0 = no isolation). Co-Authored-By: heihutu <heihutu@gmail.com>
This commit is contained in:
@@ -57,6 +57,13 @@ pub const DEFAULT_MAX_IO_EVENTS_PER_TICK: usize = 1024;
|
||||
pub const DEFAULT_EVENT_INTERVAL: u32 = 61;
|
||||
pub const DEFAULT_RNG_SEED: Option<u64> = None; // None means random
|
||||
|
||||
/// Dedicated blocking thread pool for fsync/fdatasync operations.
|
||||
/// When > 1, fsync operations are isolated from the main blocking pool to
|
||||
/// prevent device-bound fsync from starving read operations (pread/stat/open).
|
||||
/// Default 0 means auto (no isolation, use main runtime).
|
||||
pub const ENV_FSYNC_BLOCKING_THREADS: &str = "RUSTFS_RUNTIME_FSYNC_BLOCKING_THREADS";
|
||||
pub const DEFAULT_FSYNC_BLOCKING_THREADS: usize = 0;
|
||||
|
||||
// Dial9 Tokio Telemetry Default values
|
||||
pub const DEFAULT_RUNTIME_DIAL9_ENABLED: bool = false; // Disabled by default
|
||||
pub const DEFAULT_RUNTIME_DIAL9_OUTPUT_DIR: &str = "/var/log/rustfs/telemetry";
|
||||
|
||||
Reference in New Issue
Block a user