Skip to content

Commit 9488d97

Browse files
authored
feat(io-uring): Respect io-uring config options (#551)
1 parent e002009 commit 9488d97

File tree

3 files changed

+14
-1
lines changed

3 files changed

+14
-1
lines changed

riffle-server/src/config.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,16 @@ pub struct LocalfileStoreConfig {
147147
pub struct IoUringConfig {
148148
#[serde(default = "as_default_io_uring_threads")]
149149
pub threads: usize,
150+
#[serde(default = "as_default_io_uring_io_depth")]
151+
pub io_depth: usize,
152+
}
153+
154+
fn as_default_io_uring_io_depth() -> usize {
155+
64
150156
}
151157

152158
fn as_default_io_uring_threads() -> usize {
153-
1
159+
16
154160
}
155161

156162
#[derive(Clone, Debug, Serialize, Deserialize, PartialEq)]

riffle-server/src/store/local/delegator.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,8 @@ impl LocalDiskDelegator {
105105
info!("io-uring engine is activated!");
106106
OperatorBuilder::new(Arc::new(Box::new(
107107
UringIoEngineBuilder::new()
108+
.with_threads(cfg.threads)
109+
.with_io_depth(cfg.io_depth)
108110
.build(underlying_io_handler)
109111
.unwrap(),
110112
)))

riffle-server/src/store/local/uring_io.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -140,6 +140,11 @@ impl UringIoEngineBuilder {
140140
self
141141
}
142142

143+
pub fn with_io_depth(mut self, depth: usize) -> Self {
144+
self.io_depth = depth;
145+
self
146+
}
147+
143148
pub fn build(self, sync_io: SyncLocalIO) -> anyhow::Result<UringIo, WorkerError> {
144149
if self.threads == 0 {
145150
return Err(WorkerError::Other(anyhow!(

0 commit comments

Comments
 (0)