Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Eliminate some scans + store jobs in BTree #738

Merged
merged 28 commits into from
May 30, 2023
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
c21b262
avoid some scans
bcantrill May 13, 2023
1e21807
use BTreeMap instead of HashMap
bcantrill May 14, 2023
f5d03e1
Elide duplicate unencrypted contexts
jmpesp May 15, 2023
ef32020
Merge branch 'elide_duplicate_unencrypted_contexts' of github.com:jmp…
bcantrill May 15, 2023
ac66660
Elide duplicate unencrypted contexts
jmpesp May 15, 2023
79e27f0
fix "crutest dep" test failure
bcantrill May 15, 2023
092058c
`measure-iops` should submit different blocks
jmpesp May 15, 2023
e6592e5
fix test_reconnect.sh test failure
bcantrill May 18, 2023
f0df895
rustfmt
bcantrill May 18, 2023
b1fda0d
Merge branch 'main' into perfwork
bcantrill May 18, 2023
023d326
Merge branch 'perfwork' of github.com:oxidecomputer/crucible into per…
bcantrill May 27, 2023
9b0f76c
Merge branch 'main' of github.com:oxidecomputer/crucible
bcantrill May 27, 2023
d68b0b1
Merge branch 'main' into perfwork
bcantrill May 27, 2023
784f845
fix build
bcantrill May 28, 2023
e4ade77
allow flush interval to be tuned + change default
bcantrill May 17, 2023
ecd8ccd
build
bcantrill May 28, 2023
5734060
use mem::take instead of drain
faithanalog May 27, 2023
87ae64c
use INTEGER (64 bits) for hash/on_disk_hash
faithanalog May 27, 2023
e4a2f4b
downstairs sqlite: use unix-excl VFS, removing SHM file
faithanalog May 27, 2023
a0daa8b
use WITHOUT ROWID for the contexts table
faithanalog May 27, 2023
b2df7fc
fix the test suite
faithanalog May 28, 2023
98215b7
meant to get this cleanup in there
faithanalog May 28, 2023
ceaf584
Revert "meant to get this cleanup in there"
bcantrill May 28, 2023
bc69933
Revert "use WITHOUT ROWID for the contexts table"
bcantrill May 28, 2023
eab9117
Revert "downstairs sqlite: use unix-excl VFS, removing SHM file"
bcantrill May 28, 2023
244795a
Revert "use INTEGER (64 bits) for hash/on_disk_hash"
bcantrill May 28, 2023
1e90197
Revert "use mem::take instead of drain"
bcantrill May 28, 2023
a97fc2d
fix panic + reconstruction failures
bcantrill May 29, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion crucible-client-types/src/lib.rs
Original file line number Diff line number Diff line change
@@ -44,7 +44,7 @@ pub struct CrucibleOpts {
pub id: Uuid,
pub target: Vec<SocketAddr>,
pub lossy: bool,
pub flush_timeout: Option<u32>,
pub flush_timeout: Option<f32>,
pub key: Option<String>,
pub cert_pem: Option<String>,
pub key_pem: Option<String>,
4 changes: 2 additions & 2 deletions crutest/src/cli.rs
Original file line number Diff line number Diff line change
@@ -635,7 +635,7 @@ pub async fn start_cli_client(attach: SocketAddr) -> Result<()> {

println!("cli connecting to {0}", attach);

let deadline = tokio::time::sleep_until(deadline_secs(100));
let deadline = tokio::time::sleep_until(deadline_secs(100.0));
tokio::pin!(deadline);
let tcp = sock.connect(attach);
tokio::pin!(tcp);
@@ -655,7 +655,7 @@ pub async fn start_cli_client(attach: SocketAddr) -> Result<()> {
Err(e) => {
println!("connect to {0} failure: {1:?}",
attach, e);
tokio::time::sleep_until(deadline_secs(10)).await;
tokio::time::sleep_until(deadline_secs(10.0)).await;
continue 'outer;
}
}
2 changes: 1 addition & 1 deletion crutest/src/main.rs
Original file line number Diff line number Diff line change
@@ -181,7 +181,7 @@ pub struct Opt {

/// How long to wait before the auto flush check fires
#[clap(long, global = true, action)]
flush_timeout: Option<u32>,
flush_timeout: Option<f32>,

/// IP:Port for the Oximeter register address, which is Nexus.
#[clap(long, global = true, default_value = "127.0.0.1:12221", action)]
49 changes: 31 additions & 18 deletions measure_iops/src/main.rs
Original file line number Diff line number Diff line change
@@ -48,6 +48,14 @@ pub struct Opt {

#[clap(long, action)]
bw_limit_in_bytes: Option<usize>,

/// Submit all zeroes instead of random data
#[clap(long, action)]
all_zeroes: bool,

/// How long to wait before the auto flush check fires
#[clap(long, action)]
flush_timeout: Option<f32>,
}

pub fn opts() -> Result<Opt> {
@@ -74,7 +82,7 @@ async fn main() -> Result<()> {
id: Uuid::new_v4(),
target: opt.target,
lossy: false,
flush_timeout: None,
flush_timeout: opt.flush_timeout,
key: opt.key,
cert_pem: opt.cert_pem,
key_pem: opt.key_pem,
@@ -128,28 +136,33 @@ async fn main() -> Result<()> {
1
};

let write_buffers: Vec<Bytes> = (0..io_depth)
.map(|_| {
Bytes::from(
(0..io_size)
.map(|_| rng.sample(rand::distributions::Standard))
.collect::<Vec<u8>>(),
)
})
.collect();

let read_buffers: Vec<Buffer> =
(0..io_depth).map(|_| Buffer::new(io_size)).collect();

let mut io_operations_sent = 0;
let mut bw_consumed = 0;
let mut io_operation_time = Instant::now();
let mut measurement_time = Instant::now();
let mut total_io_time = Duration::ZERO;
let mut iops: Vec<f32> = vec![];
let mut bws: Vec<f32> = vec![];

'outer: loop {
let mut futures = Vec::with_capacity(io_depth);

let write_buffers: Vec<Bytes> = (0..io_depth)
.map(|_| {
Bytes::from(if opt.all_zeroes {
vec![0u8; io_size]
} else {
(0..io_size)
.map(|_| rng.sample(rand::distributions::Standard))
.collect::<Vec<u8>>()
})
})
.collect();

let io_operation_time = Instant::now();

for i in 0..io_depth {
let offset: u64 =
rng.gen::<u64>() % (total_blocks - io_size as u64 / bsz);
@@ -173,15 +186,14 @@ async fn main() -> Result<()> {

crucible::join_all(futures).await?;

total_io_time += io_operation_time.elapsed();
io_operations_sent +=
ceiling_div!(io_size * io_depth, 16 * 1024 * 1024);
bw_consumed += io_size * io_depth;

let diff = io_operation_time.elapsed();

if diff > Duration::from_secs(1) {
let fractional_seconds: f32 =
diff.as_secs() as f32 + (diff.subsec_nanos() as f32 / 1e9);
if measurement_time.elapsed() > Duration::from_secs(1) {
let fractional_seconds: f32 = total_io_time.as_secs() as f32
+ (total_io_time.subsec_nanos() as f32 / 1e9);

iops.push(io_operations_sent as f32 / fractional_seconds);
bws.push(bw_consumed as f32 / fractional_seconds);
@@ -192,7 +204,8 @@ async fn main() -> Result<()> {

io_operations_sent = 0;
bw_consumed = 0;
io_operation_time = Instant::now();
measurement_time = Instant::now();
total_io_time = Duration::ZERO;
}
}

5 changes: 2 additions & 3 deletions openapi/crucible-pantry.json
Original file line number Diff line number Diff line change
@@ -481,9 +481,8 @@
},
"flush_timeout": {
"nullable": true,
"type": "integer",
"format": "uint32",
"minimum": 0
"type": "number",
"format": "float"
},
"id": {
"type": "string",
2 changes: 1 addition & 1 deletion upstairs/src/dummy_downstairs_tests.rs
Original file line number Diff line number Diff line change
@@ -364,7 +364,7 @@ pub(crate) mod protocol_test {
let crucible_opts = CrucibleOpts {
id: Uuid::new_v4(),
target: vec![ds1.local_addr, ds2.local_addr, ds3.local_addr],
flush_timeout: Some(600),
flush_timeout: Some(600.0),

..Default::default()
};
Loading